code-foundry 1.51.1 → 1.52.1

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.
@@ -35,6 +35,11 @@ on:
35
35
  required: false
36
36
  type: string
37
37
  default: ''
38
+ build-env:
39
+ description: 'Optional JSON object of non-secret environment variables for the build command only.'
40
+ required: false
41
+ type: string
42
+ default: '{}'
38
43
  bun-version:
39
44
  required: false
40
45
  type: string
@@ -267,10 +272,44 @@ jobs:
267
272
  working-directory: ${{ inputs.working-directory }}
268
273
  env:
269
274
  BUILD_SCRIPT: ${{ inputs.build-script }}
275
+ BUILD_ENV_JSON: ${{ inputs.build-env }}
270
276
  TURBO_API: ${{ vars.TURBO_API }}
271
277
  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
272
278
  TURBO_TEAM: ${{ vars.TURBO_TEAM }}
273
- run: bun run "$BUILD_SCRIPT"
279
+ run: |
280
+ node --input-type=module <<'NODE'
281
+ import { spawnSync } from 'node:child_process'
282
+ const input = process.env.BUILD_ENV_JSON
283
+ let buildEnv
284
+ try {
285
+ buildEnv = JSON.parse(input)
286
+ } catch {
287
+ throw new Error('build-env must be a JSON object of string values')
288
+ }
289
+ if (!buildEnv || typeof buildEnv !== 'object' || Array.isArray(buildEnv)) {
290
+ throw new Error('build-env must be a JSON object of string values')
291
+ }
292
+ const allowedNames = new Set([
293
+ 'ADEA_PREVIEW_HYPERDRIVE_ID',
294
+ 'ADEA_PREVIEW_SECRETS_STORE_ID',
295
+ 'ADEA_PREVIEW_DATABASE_URL_SECRET',
296
+ 'ADEA_PREVIEW_AUTH_BASE_URL_SECRET',
297
+ 'ADEA_PREVIEW_AUTH_COOKIE_SECRET_NAME',
298
+ 'ADEA_PREVIEW_AUTH_TRUSTED_ORIGINS_SECRET',
299
+ ])
300
+ for (const [name, value] of Object.entries(buildEnv)) {
301
+ if (!allowedNames.has(name)) {
302
+ throw new Error(`Invalid build-env variable name: ${name}`)
303
+ }
304
+ if (typeof value !== 'string') throw new Error(`build-env value for ${name} must be a string`)
305
+ }
306
+ const result = spawnSync('bun', ['run', process.env.BUILD_SCRIPT], {
307
+ stdio: 'inherit',
308
+ env: { ...process.env, ...buildEnv },
309
+ })
310
+ if (result.error) throw result.error
311
+ process.exit(result.status ?? 1)
312
+ NODE
274
313
  - name: Deploy to Cloudflare
275
314
  id: deploy
276
315
  if: steps.check.outputs.should_deploy != 'false'
@@ -21,13 +21,20 @@ jobs:
21
21
  runs-on: ubuntu-slim
22
22
  timeout-minutes: 5
23
23
  steps:
24
- - name: Cancel queued and running checks for this branch
24
+ - name: Cancel queued and running checks for this pull request
25
25
  env:
26
26
  GH_TOKEN: ${{ github.token }}
27
27
  HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
28
+ PR_NUMBER: ${{ github.event.pull_request.number }}
28
29
  CURRENT_RUN_ID: ${{ github.run_id }}
29
30
  run: |
30
31
  set -euo pipefail
32
+ if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
33
+ echo '::error title=Draft control cannot verify pull request::The event did not include a valid pull request number.'
34
+ exit 1
35
+ fi
36
+ # Only runs associated with this PR may be cancelled. Branch names can
37
+ # be shared by multiple PRs, including heads from different forks.
31
38
  for status in queued in_progress; do
32
39
  gh api "repos/$GITHUB_REPOSITORY/actions/runs" \
33
40
  --method GET \
@@ -35,7 +42,7 @@ jobs:
35
42
  -f event=pull_request \
36
43
  -f status="$status" \
37
44
  --paginate \
38
- --jq '.workflow_runs[].id' |
45
+ --jq ".workflow_runs[]? | select(any(.pull_requests[]?; .number == $PR_NUMBER)) | .id" |
39
46
  while read -r run_id; do
40
47
  if [ -n "$run_id" ] && [ "$run_id" -lt "$CURRENT_RUN_ID" ]; then
41
48
  gh api \
@@ -45,4 +52,4 @@ jobs:
45
52
  fi
46
53
  done
47
54
  done
48
- echo "CI is halted while pull request #${{ github.event.pull_request.number }} remains draft."
55
+ echo "CI is halted while pull request #$PR_NUMBER remains draft."
@@ -122,7 +122,7 @@ jobs:
122
122
  FOUNDRY_REQUIRED_JOB_NAMES_JSON: ${{ inputs.required-job-names-json }}
123
123
  run: |
124
124
  if [ "$SOURCE_READY" = success ] && [ "$RUNTIME_READY" = success ] && [ "$NODE_READY" = success ] && [ "$POLICY_READY" = success ] && [ -f "$RUNTIME_PATH/src/commands/qualification-receipt.mjs" ]; then
125
- node "$RUNTIME_PATH/src/commands/qualification-receipt.mjs" verify >> "$GITHUB_OUTPUT"
125
+ node "$RUNTIME_PATH/src/commands/qualification-receipt.mjs" verify
126
126
  else
127
127
  echo 'reuse=false' >> "$GITHUB_OUTPUT"
128
128
  echo 'reason=qualification or version-only release policy unavailable; using full validation' >> "$GITHUB_OUTPUT"
@@ -185,7 +185,7 @@ jobs:
185
185
  FOUNDRY_REQUIRED_JOB_NAMES_JSON: ${{ inputs.required-job-names-json }}
186
186
  run: |
187
187
  if [ "$SOURCE_READY" = success ] && [ "$RUNTIME_READY" = success ] && [ "$NODE_READY" = success ] && [ -f "$RUNTIME_PATH/src/commands/qualification-receipt.mjs" ]; then
188
- node "$RUNTIME_PATH/src/commands/qualification-receipt.mjs" produce >> "$GITHUB_OUTPUT"
188
+ node "$RUNTIME_PATH/src/commands/qualification-receipt.mjs" produce
189
189
  else
190
190
  echo 'reuse=false' >> "$GITHUB_OUTPUT"
191
191
  echo 'reason=receipt setup unavailable' >> "$GITHUB_OUTPUT"
@@ -1286,7 +1286,7 @@ jobs:
1286
1286
  name: Qualification receipt
1287
1287
  needs: [fast-lanes, lint, type-check, unit, e2e, audit, codeql, gate]
1288
1288
  if: >-
1289
- vars.CI_BILLING_PAUSED != 'true' && inputs.mode == 'audit' &&
1289
+ !cancelled() && vars.CI_BILLING_PAUSED != 'true' && inputs.mode == 'audit' &&
1290
1290
  inputs.release-qualification-receipts == true &&
1291
1291
  github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' &&
1292
1292
  needs.fast-lanes.result == 'success' && needs.lint.result == 'success' &&
@@ -272,7 +272,7 @@ jobs:
272
272
  name: Qualification receipt
273
273
  needs: [ci, test, security, eval, gate]
274
274
  if: >-
275
- vars.CI_BILLING_PAUSED != 'true' && inputs.mode == 'audit' &&
275
+ !cancelled() && vars.CI_BILLING_PAUSED != 'true' && inputs.mode == 'audit' &&
276
276
  inputs.release-qualification-receipts == true &&
277
277
  github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' &&
278
278
  needs.ci.result == 'success' && needs.test.result == 'success' &&
@@ -288,7 +288,7 @@ jobs:
288
288
  name: Qualification receipt
289
289
  needs: [ci, test, security, codeql, eval, gate]
290
290
  if: >-
291
- vars.CI_BILLING_PAUSED != 'true' && inputs.mode == 'audit' &&
291
+ !cancelled() && vars.CI_BILLING_PAUSED != 'true' && inputs.mode == 'audit' &&
292
292
  inputs.release-qualification-receipts == true &&
293
293
  github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' &&
294
294
  needs.ci.result == 'success' && needs.test.result == 'success' &&
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.52.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.52.0...v1.52.1) (2026-10-30)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * restore source qualification receipt reuse ([#801](https://github.com/0xPlayerOne/code-foundry/issues/801)) ([989bdbf](https://github.com/0xPlayerOne/code-foundry/commit/989bdbfe5af6d2003ca97dde456d8c86fb92078c))
9
+
10
+ ## [1.52.0](https://github.com/0xPlayerOne/code-foundry/compare/v1.51.1...v1.52.0) (2026-10-30)
11
+
12
+
13
+ ### Features
14
+
15
+ * scope Cloudflare build variables to build ([#802](https://github.com/0xPlayerOne/code-foundry/issues/802)) ([1f9a89f](https://github.com/0xPlayerOne/code-foundry/commit/1f9a89fa19a868732805a065fe90cc7609928a1e))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * scope draft cancellation to its pull request ([#799](https://github.com/0xPlayerOne/code-foundry/issues/799)) ([ba42e81](https://github.com/0xPlayerOne/code-foundry/commit/ba42e811729e6ab8a82e2941abfdaab4f8544eed))
21
+
3
22
  ## [1.51.1](https://github.com/0xPlayerOne/code-foundry/compare/v1.51.0...v1.51.1) (2026-10-29)
4
23
 
5
24
 
@@ -126,23 +145,9 @@
126
145
 
127
146
  * add opt-in Vite+ task runner support ([#763](https://github.com/0xPlayerOne/code-foundry/issues/763)) ([f7970cd](https://github.com/0xPlayerOne/code-foundry/commit/f7970cdf1c1880aaee159d2de79ba043f93711a7))
128
147
 
129
- ## [1.47.5](https://github.com/0xPlayerOne/code-foundry/compare/v1.47.4...v1.47.5) (2026-10-15)
130
-
131
-
132
- ### Bug Fixes
133
-
134
- * validation-issue-read-v1471 ([#759](https://github.com/0xPlayerOne/code-foundry/issues/759)) ([7119b3e](https://github.com/0xPlayerOne/code-foundry/commit/7119b3e2baebfbfdd47d32428cbf5df2f2079afa))
135
-
136
- ## [1.47.4](https://github.com/0xPlayerOne/code-foundry/compare/v1.47.3...v1.47.4) (2026-10-15)
137
-
138
-
139
- ### Documentation
140
-
141
- * fix generated agent contribution and validation references ([#760](https://github.com/0xPlayerOne/code-foundry/issues/760)) ([c3564c9](https://github.com/0xPlayerOne/code-foundry/commit/c3564c92cb168449317afe2e40359144bf7a0c71))
142
-
143
148
  <!-- code-foundry: packaged changelog -->
144
149
 
145
150
  ---
146
151
 
147
- This packaged changelog lists the 20 most recent releases; 265 older releases are omitted to keep the package small.
152
+ This packaged changelog lists the 20 most recent releases; 267 older releases are omitted to keep the package small.
148
153
  See the [full changelog](https://github.com/0xPlayerOne/code-foundry/blob/main/CHANGELOG.md) for the complete history.
@@ -34,8 +34,10 @@ and 118 files.
34
34
  On v1.50.1 base `f671dd8`, the measured artifact was 315,853 packed bytes,
35
35
  1,200,759 unpacked bytes, and 120 files. Release caller publication overrides
36
36
  measure 316,295 packed bytes, 1,222,905 unpacked bytes, and 120 files: an
37
- increase of 442 packed bytes and 22,146 unpacked bytes. The packed limit is
38
- 316,500 bytes, leaving 205 bytes of measured headroom; the unpacked and file-count
37
+ increase of 442 packed bytes and 22,146 unpacked bytes. The packed limit was
38
+ raised to 317,000 bytes for the optional build environment input in the
39
+ Cloudflare reusable workflow, which ships in the npm package. This leaves 235
40
+ bytes above the measured 316,765-byte artifact. The unpacked and file-count
39
41
  limits remain 1,225,000 bytes and 120 files.
40
42
 
41
43
  The published package ships a changelog trimmed to the 20 most recent releases
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "1.51.1",
3
+ "version": "1.52.1",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "homepage": "https://github.com/0xPlayerOne/code-foundry#readme",
6
6
  "bugs": {