code-foundry 0.31.3 → 0.31.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.31.4](https://github.com/0xPlayerOne/code-foundry/compare/v0.31.3...v0.31.4) (2026-07-29)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * harden fleet pins and github doctor ([c6efa7a](https://github.com/0xPlayerOne/code-foundry/commit/c6efa7a436308959950d958c5897574193cd763b))
9
+
3
10
  ## [0.31.3](https://github.com/0xPlayerOne/code-foundry/compare/v0.31.2...v0.31.3) (2026-07-29)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.31.3",
3
+ "version": "0.31.4",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",
@@ -1,6 +1,6 @@
1
1
  // @ts-check
2
2
 
3
- import { existsSync, mkdtempSync, readFileSync, readdirSync } from 'node:fs'
3
+ import { existsSync, mkdtempSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'
4
4
  import { join } from 'node:path'
5
5
  import { tmpdir } from 'node:os'
6
6
  import { spawnSync } from 'node:child_process'
@@ -73,6 +73,17 @@ function upgradeRepository(repository, source, version) {
73
73
  const add = spawnSync('git', ['-C', repository.path, 'worktree', 'add', '-b', branch, temporary, baseline.stdout.trim()], { encoding: 'utf8' })
74
74
  if (add.status !== 0) return { path: repository.path, status: 'skipped', reason: add.stderr.trim() || 'unable to create isolated worktree' }
75
75
  const result = syncRepository({ target: temporary, source, force: false })
76
+ const configFile = join(temporary, '.github/code-foundry.yml')
77
+ if (existsSync(configFile)) {
78
+ const current = readFileSync(configFile, 'utf8')
79
+ const updated = current.match(/^runtime_ref:\s*.*$/m)
80
+ ? current.replace(/^runtime_ref:\s*.*$/m, `runtime_ref: ${version}`)
81
+ : `${current.trimEnd()}\nruntime_ref: ${version}\n`
82
+ if (updated !== current) {
83
+ writeFileSync(configFile, updated)
84
+ if (!result.changed.includes('.github/code-foundry.yml')) result.changed.push('.github/code-foundry.yml')
85
+ }
86
+ }
76
87
  if (!result.changed.length) return { path: repository.path, status: 'unchanged', branch }
77
88
  spawnSync('git', ['-C', temporary, 'add', '-A'], { stdio: 'ignore' })
78
89
  const commit = spawnSync('git', ['-C', temporary, 'commit', '-m', `chore(code-foundry): upgrade runtime to ${version}`], { encoding: 'utf8' })
@@ -55,6 +55,16 @@ export function doctorGithub(root) {
55
55
  if (['workflow-dispatch', 'dispatch'].includes(config.post_release_mode) && config.post_release !== 'false' && !details.secrets.releasePleaseTokenPresent) {
56
56
  errors.push('post-release workflow-dispatch mode requires RELEASE_PLEASE_TOKEN to be present.')
57
57
  }
58
+ const credentialChecks = {
59
+ npmTokenPresent: secretNames.includes('NPM_TOKEN'),
60
+ turboTokenPresent: secretNames.includes('TURBO_TOKEN'),
61
+ turboTeamPresent: Boolean(ghJson(['variable', 'list', '--repo', repository, '--json', 'name'])?.some(/** @param {{ name?: string }} variable */ (variable) => variable.name === 'TURBO_TEAM')),
62
+ opencodeApiKeyPresent: secretNames.includes('OPENCODE_API_KEY'),
63
+ }
64
+ details.credentials = credentialChecks
65
+ if (config.npm_publish === 'true' && !credentialChecks.npmTokenPresent) warnings.push('npm_publish is enabled but NPM_TOKEN is not configured; npm trusted publishing must be configured for tokenless publication.')
66
+ if (['true', 'auto'].includes(config.turbo_remote ?? 'false') && (!credentialChecks.turboTokenPresent || !credentialChecks.turboTeamPresent)) warnings.push('turbo_remote is enabled but TURBO_TOKEN and/or TURBO_TEAM is not configured; remote caching will be skipped.')
67
+ if (['true', 'auto'].includes(config.opencode_security ?? 'false') && !credentialChecks.opencodeApiKeyPresent) warnings.push('opencode_security is enabled but OPENCODE_API_KEY is not configured; the optional scan will be skipped.')
58
68
 
59
69
  const prs = ghJson(['pr', 'list', '--repo', repository, '--state', 'open', '--base', 'main', '--json', 'number,title,headRefName'])
60
70
  const openPrs = Array.isArray(prs) ? prs : []