code-foundry 1.9.5 → 1.9.7
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/.github/CONTRIBUTING.md +27 -33
- package/.github/SECURITY.md +1 -2
- package/.github/actions/setup/action.yml +2 -1
- package/.github/code-foundry.yml +1 -3
- package/.github/workflows/ci.yml +8 -8
- package/.github/workflows/cloudflare-deploy.yml +33 -0
- package/.github/workflows/codeql.yml +1 -1
- package/.github/workflows/draft-control_self-ci.yml +44 -0
- package/.github/workflows/opencode-security_self-ci.yml +6 -14
- package/.github/workflows/release.yml +8 -4
- package/.github/workflows/release_self-ci.yml +0 -1
- package/.github/workflows/security.yml +12 -9
- package/.github/workflows/test.yml +10 -10
- package/.github/workflows/validation.yml +7 -6
- package/.github/workflows/validation_self-ci.yml +4 -9
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +15 -0
- package/README.md +6 -4
- package/docs/CONFIGURATION.md +13 -11
- package/docs/RELEASES.md +2 -2
- package/docs/WORKFLOWS.md +23 -21
- package/package.json +1 -1
- package/src/commands/doctor.mjs +29 -8
- package/src/commands/sync.mjs +76 -27
- package/src/lib/github-doctor.mjs +50 -10
- package/src/lib/validation-policy.mjs +7 -9
package/.github/CONTRIBUTING.md
CHANGED
|
@@ -19,7 +19,7 @@ Agents must follow these rules before changing code:
|
|
|
19
19
|
1. Read this file, `AGENTS.md`, and the relevant project documentation.
|
|
20
20
|
2. Inspect the current branch, worktree, remotes, and existing changes before editing.
|
|
21
21
|
3. Preserve user-owned changes. Never discard or overwrite unrelated work.
|
|
22
|
-
4. Branch from `
|
|
22
|
+
4. Branch from `main` and target pull requests at `main`; do not push directly to `main`.
|
|
23
23
|
5. Keep the change focused. Do not expand scope without documenting why.
|
|
24
24
|
6. Run the applicable format, lint, type-check, build, unit, performance, integration, E2E, smoke, and security checks.
|
|
25
25
|
7. Report exact validation results, skipped checks, known limitations, and remaining risks.
|
|
@@ -35,22 +35,20 @@ Agents must not:
|
|
|
35
35
|
## Branching model
|
|
36
36
|
|
|
37
37
|
```text
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
feat/* fix/* chore/* ──PR──▶
|
|
42
|
-
docs/* test/* refactor/* │
|
|
43
|
-
|
|
44
|
-
└── integration branch
|
|
38
|
+
release PR
|
|
39
|
+
┌──────────────┐
|
|
40
|
+
│ ▼
|
|
41
|
+
feat/* fix/* chore/* ──PR──▶ main
|
|
42
|
+
docs/* test/* refactor/* │
|
|
43
|
+
└── protected release branch
|
|
45
44
|
```
|
|
46
45
|
|
|
47
|
-
| Branch | Purpose | Contribution rule
|
|
48
|
-
| -------------------------------------------------------------- | ------------------------ |
|
|
49
|
-
| `main` | Protected release branch | Merge through
|
|
50
|
-
| `
|
|
51
|
-
| `feat/*`, `fix/*`, `chore/*`, `refactor/*`, `docs/*`, `test/*` | Focused work | Branch from `staging`; keep changes small and reviewable. |
|
|
46
|
+
| Branch | Purpose | Contribution rule |
|
|
47
|
+
| -------------------------------------------------------------- | ------------------------ | ------------------------------------------------------ |
|
|
48
|
+
| `main` | Protected release branch | Merge through pull requests only. No direct pushes. |
|
|
49
|
+
| `feat/*`, `fix/*`, `chore/*`, `refactor/*`, `docs/*`, `test/*` | Focused work | Branch from `main`; keep changes small and reviewable. |
|
|
52
50
|
|
|
53
|
-
The Git workflow is `
|
|
51
|
+
The Git workflow is `direct`: topic branches **squash** directly into `main`, and the Release Please version PR **squashes** into `main` (`release_merge_strategy: squash`). Release automation never defaults to a merge method and never merges with `--admin`; `code-foundry doctor` and `code-foundry sync` fail closed on any other release merge strategy. This repository has one protected integration and release branch: `main`.
|
|
54
52
|
|
|
55
53
|
## Before you start
|
|
56
54
|
|
|
@@ -67,8 +65,8 @@ The Git workflow is `staging-release`: topic branches **squash** into `staging`,
|
|
|
67
65
|
```sh
|
|
68
66
|
git status --short --branch
|
|
69
67
|
git fetch origin
|
|
70
|
-
git switch
|
|
71
|
-
git pull --ff-only origin
|
|
68
|
+
git switch main
|
|
69
|
+
git pull --ff-only origin main
|
|
72
70
|
git switch -c feat/short-description
|
|
73
71
|
```
|
|
74
72
|
|
|
@@ -93,7 +91,7 @@ Run the checks relevant to the change. For a release or security-sensitive chang
|
|
|
93
91
|
|
|
94
92
|
For maintainers, trusted contributors, and automation agents:
|
|
95
93
|
|
|
96
|
-
1. Start from an up-to-date `
|
|
94
|
+
1. Start from an up-to-date `main` branch.
|
|
97
95
|
2. Create a focused branch with a descriptive prefix.
|
|
98
96
|
3. Inspect the relevant code and tests before making changes.
|
|
99
97
|
4. Implement the smallest complete change.
|
|
@@ -107,9 +105,9 @@ For maintainers, trusted contributors, and automation agents:
|
|
|
107
105
|
chore(ci): cache Rust dependencies
|
|
108
106
|
```
|
|
109
107
|
|
|
110
|
-
8. Push the branch and open a pull request into `
|
|
108
|
+
8. Push the branch and open a pull request into `main`.
|
|
111
109
|
9. Address review feedback and failed checks on the same branch.
|
|
112
|
-
10. Merge with a squash after required checks pass and the change is ready; feature PRs land on `
|
|
110
|
+
10. Merge with a squash after required checks pass and the change is ready; feature PRs land on `main` with squash merges.
|
|
113
111
|
|
|
114
112
|
### Internal agent handoff
|
|
115
113
|
|
|
@@ -130,11 +128,11 @@ For contributors who do not have direct write access:
|
|
|
130
128
|
|
|
131
129
|
1. Fork the repository on GitHub.
|
|
132
130
|
2. Add the upstream repository as `upstream`.
|
|
133
|
-
3. Branch from the upstream `
|
|
131
|
+
3. Branch from the upstream `main` branch.
|
|
134
132
|
4. Make a focused change and follow the local setup instructions.
|
|
135
133
|
5. Add tests and documentation for behavior changes.
|
|
136
134
|
6. Run all applicable checks locally.
|
|
137
|
-
7. Push to the fork and open a pull request targeting `
|
|
135
|
+
7. Push to the fork and open a pull request targeting `main`.
|
|
138
136
|
8. Explain the problem, proposed solution, validation, compatibility, and rollout impact.
|
|
139
137
|
9. Address maintainer feedback without rewriting unrelated history or scope.
|
|
140
138
|
|
|
@@ -157,17 +155,14 @@ Keep pull requests focused and reviewable. Include screenshots or recordings for
|
|
|
157
155
|
|
|
158
156
|
| Event | Expected automation |
|
|
159
157
|
| -------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
160
|
-
| Draft pull request targeting `
|
|
161
|
-
| Ready pull request targeting `
|
|
162
|
-
| Draft ordinary pull request targeting `main` | No runner-heavy validation; run local checks before requesting review |
|
|
163
|
-
| Ready ordinary pull request targeting `main` | Audit validation: CI, full tests, Security, and CodeQL, ending in `Validation / Gate` |
|
|
158
|
+
| Draft pull request targeting `main` | No runner-heavy validation; run local checks before requesting review |
|
|
159
|
+
| Ready pull request targeting `main` | Audit validation: CI, full tests, Security, and CodeQL, ending in `Validation / Gate` |
|
|
164
160
|
| Exact Release Please pull request targeting `main` | Release-policy validation only, ending in `Validation / Gate` |
|
|
165
161
|
| Scheduled or manual validation | Full audit tier |
|
|
166
162
|
| Push to a working branch | Draft PR workflow |
|
|
167
|
-
| Push to `staging` | Promotion PR workflow; canonical validation waits for the PR event |
|
|
168
163
|
| Push to `main` | Release workflow; canonical validation already ran on the merged PR |
|
|
169
164
|
|
|
170
|
-
Draft pull requests do not start
|
|
165
|
+
Draft pull requests do not start validation. Marking a pull request ready for review starts the applicable validation tier. Convert it back to draft after an update, then mark it ready again after every update so the required checks attach to the current head. Converting it to draft runs only the lightweight cancellation control.
|
|
171
166
|
|
|
172
167
|
Pull-request validation keys concurrency by event and pull-request head, so a newer update cancels its superseded run. Scheduled and manual audits use a separate caller pinned to the protected default branch; this prevents caller-selected runtime code from executing with default-branch cache access. Both callers use the mode-aware orchestrator, which fans out only the required jobs and concludes with the stable aggregate gate.
|
|
173
168
|
|
|
@@ -181,11 +176,10 @@ Security checks can be skipped when repository visibility or the GitHub plan doe
|
|
|
181
176
|
|
|
182
177
|
## Review and merge protocol
|
|
183
178
|
|
|
184
|
-
| Change
|
|
185
|
-
|
|
|
186
|
-
| Working branch
|
|
187
|
-
|
|
|
188
|
-
| Release Please version PR | `main` | Rebase (`release_merge_strategy`, fails closed) | Validation gate and release policy pass |
|
|
179
|
+
| Change | Target | Merge method | Merge gate |
|
|
180
|
+
| ------------------------- | ------ | --------------------------------- | --------------------------------------- |
|
|
181
|
+
| Working branch | `main` | Squash | All applicable required checks pass |
|
|
182
|
+
| Release Please version PR | `main` | Squash (`release_merge_strategy`) | Validation gate and release policy pass |
|
|
189
183
|
|
|
190
184
|
Reviewers focus on correctness, security, maintainability, test coverage, operational impact, and compatibility. Authors remain responsible for responding to feedback and verifying the final commit.
|
|
191
185
|
|
|
@@ -195,7 +189,7 @@ Report vulnerabilities privately using [SECURITY.md](./SECURITY.md), never in a
|
|
|
195
189
|
|
|
196
190
|
For an urgent production or security issue:
|
|
197
191
|
|
|
198
|
-
1. Create a focused branch from `
|
|
192
|
+
1. Create a focused branch from `main`.
|
|
199
193
|
2. Document the urgency and affected systems without exposing secrets.
|
|
200
194
|
3. Open a pull request and run the narrowest complete validation available.
|
|
201
195
|
4. Request the appropriate maintainer review.
|
package/.github/SECURITY.md
CHANGED
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
## Supported Versions
|
|
6
6
|
|
|
7
|
-
The latest commit on `
|
|
7
|
+
The latest commit on `main` receives security patches.
|
|
8
8
|
|
|
9
9
|
| Branch | Supported |
|
|
10
10
|
| ---------------- | --------- |
|
|
11
|
-
| `staging` | ✅ |
|
|
12
11
|
| `main` | ✅ |
|
|
13
12
|
| Feature branches | ❌ |
|
|
14
13
|
|
|
@@ -748,8 +748,9 @@ runs:
|
|
|
748
748
|
${{ runner.os }}-rust-build-v2-
|
|
749
749
|
- name: Setup
|
|
750
750
|
if: ${{ steps.profile.outputs.mise_required == 'true' }}
|
|
751
|
-
uses: jdx/mise-action@v4
|
|
751
|
+
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4
|
|
752
752
|
with:
|
|
753
|
+
version: 2026.9.2
|
|
753
754
|
cache: true
|
|
754
755
|
install_args: ${{ steps.profile.outputs.mise_tools }}
|
|
755
756
|
- name: Setup Rust components
|
package/.github/code-foundry.yml
CHANGED
|
@@ -11,7 +11,7 @@ dependency_review: auto
|
|
|
11
11
|
package_manager: bun
|
|
12
12
|
toolchain: auto
|
|
13
13
|
runtime_repository: 0xPlayerOne/code-foundry
|
|
14
|
-
runtime_ref: v1.
|
|
14
|
+
runtime_ref: v1.9.6
|
|
15
15
|
release_type: node
|
|
16
16
|
npm_publish: true
|
|
17
17
|
license: agpl-3.0-or-later
|
|
@@ -35,10 +35,8 @@ prune_standard: false
|
|
|
35
35
|
post_release: false
|
|
36
36
|
post_release_workflow:
|
|
37
37
|
post_release_mode: auto
|
|
38
|
-
opencode_security: false
|
|
39
38
|
sync_mode: overlay
|
|
40
39
|
custom_workflows: preserve
|
|
41
|
-
staging_validation_mode: fast
|
|
42
40
|
performance: auto
|
|
43
41
|
performance_command:
|
|
44
42
|
performance_profile:
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -71,7 +71,7 @@ jobs:
|
|
|
71
71
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
72
72
|
- name: Detect
|
|
73
73
|
id: applicability
|
|
74
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci should_run format >> "$GITHUB_OUTPUT"
|
|
74
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci should_run format >> "$GITHUB_OUTPUT"
|
|
75
75
|
- name: Setup
|
|
76
76
|
if: steps.applicability.outputs.applicable == 'true'
|
|
77
77
|
uses: ./.github/actions/setup
|
|
@@ -86,7 +86,7 @@ jobs:
|
|
|
86
86
|
task: format
|
|
87
87
|
- name: Format
|
|
88
88
|
if: steps.applicability.outputs.applicable == 'true'
|
|
89
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci format
|
|
89
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci format
|
|
90
90
|
|
|
91
91
|
lint:
|
|
92
92
|
name: Lint
|
|
@@ -115,7 +115,7 @@ jobs:
|
|
|
115
115
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
116
116
|
- name: Detect
|
|
117
117
|
id: applicability
|
|
118
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci should_run lint >> "$GITHUB_OUTPUT"
|
|
118
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci should_run lint >> "$GITHUB_OUTPUT"
|
|
119
119
|
- name: Setup
|
|
120
120
|
if: steps.applicability.outputs.applicable == 'true'
|
|
121
121
|
uses: ./.github/actions/setup
|
|
@@ -125,7 +125,7 @@ jobs:
|
|
|
125
125
|
task: lint
|
|
126
126
|
- name: Lint
|
|
127
127
|
if: steps.applicability.outputs.applicable == 'true'
|
|
128
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci lint
|
|
128
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci lint
|
|
129
129
|
|
|
130
130
|
type-check:
|
|
131
131
|
name: Type-Check
|
|
@@ -154,7 +154,7 @@ jobs:
|
|
|
154
154
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
155
155
|
- name: Detect
|
|
156
156
|
id: applicability
|
|
157
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci should_run type_check >> "$GITHUB_OUTPUT"
|
|
157
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci should_run type_check >> "$GITHUB_OUTPUT"
|
|
158
158
|
- name: Setup
|
|
159
159
|
if: steps.applicability.outputs.applicable == 'true'
|
|
160
160
|
uses: ./.github/actions/setup
|
|
@@ -164,7 +164,7 @@ jobs:
|
|
|
164
164
|
task: type_check
|
|
165
165
|
- name: Type-Check
|
|
166
166
|
if: steps.applicability.outputs.applicable == 'true'
|
|
167
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci type_check
|
|
167
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci type_check
|
|
168
168
|
|
|
169
169
|
build:
|
|
170
170
|
name: Build
|
|
@@ -198,7 +198,7 @@ jobs:
|
|
|
198
198
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
199
199
|
- name: Detect
|
|
200
200
|
id: applicability
|
|
201
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci should_run build >> "$GITHUB_OUTPUT"
|
|
201
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci should_run build >> "$GITHUB_OUTPUT"
|
|
202
202
|
- name: Setup
|
|
203
203
|
if: steps.applicability.outputs.applicable == 'true'
|
|
204
204
|
uses: ./.github/actions/setup
|
|
@@ -208,4 +208,4 @@ jobs:
|
|
|
208
208
|
task: build
|
|
209
209
|
- name: Build
|
|
210
210
|
if: steps.applicability.outputs.applicable == 'true'
|
|
211
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci build
|
|
211
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci build
|
|
@@ -13,6 +13,21 @@ on:
|
|
|
13
13
|
required: false
|
|
14
14
|
type: string
|
|
15
15
|
default: '.'
|
|
16
|
+
install-working-directory:
|
|
17
|
+
description: 'Directory containing bun.lock. Used only when build-script is set.'
|
|
18
|
+
required: false
|
|
19
|
+
type: string
|
|
20
|
+
default: '.'
|
|
21
|
+
build-script:
|
|
22
|
+
description: 'Optional Bun package script to run before Wrangler deploys.'
|
|
23
|
+
required: false
|
|
24
|
+
type: string
|
|
25
|
+
default: ''
|
|
26
|
+
bun-version:
|
|
27
|
+
description: 'Bun version used for dependency installation and the optional build.'
|
|
28
|
+
required: false
|
|
29
|
+
type: string
|
|
30
|
+
default: '1.4.0'
|
|
16
31
|
runner:
|
|
17
32
|
required: false
|
|
18
33
|
type: string
|
|
@@ -48,6 +63,24 @@ jobs:
|
|
|
48
63
|
with:
|
|
49
64
|
persist-credentials: false
|
|
50
65
|
|
|
66
|
+
- name: Set up Bun
|
|
67
|
+
if: inputs.build-script != ''
|
|
68
|
+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
69
|
+
with:
|
|
70
|
+
bun-version: ${{ inputs.bun-version }}
|
|
71
|
+
|
|
72
|
+
- name: Install dependencies
|
|
73
|
+
if: inputs.build-script != ''
|
|
74
|
+
working-directory: ${{ inputs.install-working-directory }}
|
|
75
|
+
run: bun install --frozen-lockfile
|
|
76
|
+
|
|
77
|
+
- name: Build Worker
|
|
78
|
+
if: inputs.build-script != ''
|
|
79
|
+
working-directory: ${{ inputs.working-directory }}
|
|
80
|
+
env:
|
|
81
|
+
BUILD_SCRIPT: ${{ inputs.build-script }}
|
|
82
|
+
run: bun run "$BUILD_SCRIPT"
|
|
83
|
+
|
|
51
84
|
- name: Deploy to Cloudflare
|
|
52
85
|
id: deploy
|
|
53
86
|
working-directory: ${{ inputs.working-directory }}
|
|
@@ -131,7 +131,7 @@ jobs:
|
|
|
131
131
|
REPO_FOUNDRY_CODE_SECURITY: ${{ steps.security.outputs.status }}
|
|
132
132
|
REPO_FOUNDRY_PRIVATE: ${{ github.event.repository.private }}
|
|
133
133
|
REPO_FOUNDRY_VISIBILITY: ${{ github.event.repository.visibility }}
|
|
134
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs codeql
|
|
134
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" codeql
|
|
135
135
|
- id: matrix
|
|
136
136
|
name: Build analysis matrix
|
|
137
137
|
env:
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Code Foundry Draft Control
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main, staging]
|
|
6
|
+
types:
|
|
7
|
+
- converted_to_draft
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
actions: write
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
cancel:
|
|
15
|
+
name: Draft Control / Halt CI
|
|
16
|
+
if: vars.CI_BILLING_PAUSED != 'true'
|
|
17
|
+
runs-on: ubuntu-slim
|
|
18
|
+
timeout-minutes: 5
|
|
19
|
+
steps:
|
|
20
|
+
- name: Cancel queued and running checks for this branch
|
|
21
|
+
env:
|
|
22
|
+
GH_TOKEN: ${{ github.token }}
|
|
23
|
+
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
|
|
24
|
+
CURRENT_RUN_ID: ${{ github.run_id }}
|
|
25
|
+
run: |
|
|
26
|
+
set -euo pipefail
|
|
27
|
+
for status in queued in_progress; do
|
|
28
|
+
gh api "repos/$GITHUB_REPOSITORY/actions/runs" \
|
|
29
|
+
--method GET \
|
|
30
|
+
-f branch="$HEAD_BRANCH" \
|
|
31
|
+
-f event=pull_request \
|
|
32
|
+
-f status="$status" \
|
|
33
|
+
--paginate \
|
|
34
|
+
--jq '.workflow_runs[].id' |
|
|
35
|
+
while read -r run_id; do
|
|
36
|
+
if [ -n "$run_id" ] && [ "$run_id" -lt "$CURRENT_RUN_ID" ]; then
|
|
37
|
+
gh api \
|
|
38
|
+
--method POST \
|
|
39
|
+
"repos/$GITHUB_REPOSITORY/actions/runs/$run_id/cancel" \
|
|
40
|
+
--silent || true
|
|
41
|
+
fi
|
|
42
|
+
done
|
|
43
|
+
done
|
|
44
|
+
echo "CI is halted while pull request #${{ github.event.pull_request.number }} remains draft."
|
|
@@ -4,11 +4,7 @@ on:
|
|
|
4
4
|
pull_request:
|
|
5
5
|
branches: [main, staging]
|
|
6
6
|
types:
|
|
7
|
-
- opened
|
|
8
|
-
- synchronize
|
|
9
|
-
- reopened
|
|
10
7
|
- ready_for_review
|
|
11
|
-
- converted_to_draft
|
|
12
8
|
workflow_dispatch:
|
|
13
9
|
|
|
14
10
|
permissions:
|
|
@@ -20,8 +16,7 @@ jobs:
|
|
|
20
16
|
if: >-
|
|
21
17
|
vars.CI_BILLING_PAUSED != 'true' &&
|
|
22
18
|
(github.event_name == 'workflow_dispatch' ||
|
|
23
|
-
(github.event.pull_request.
|
|
24
|
-
startsWith(github.event.pull_request.head.ref, 'release-please--branches--main')))
|
|
19
|
+
startsWith(github.event.pull_request.head.ref, 'release-please--branches--main'))
|
|
25
20
|
runs-on: ubuntu-slim
|
|
26
21
|
outputs:
|
|
27
22
|
enabled: ${{ steps.detect.outputs.enabled }}
|
|
@@ -35,18 +30,15 @@ jobs:
|
|
|
35
30
|
id: detect
|
|
36
31
|
env:
|
|
37
32
|
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
|
|
38
|
-
|
|
33
|
+
OPENCODE_SECURITY: ${{ vars.OPENCODE_SECURITY }}
|
|
39
34
|
run: |
|
|
40
35
|
enabled=false
|
|
41
36
|
token=false
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
|
|
45
|
-
if [ "$OPENCODE_SECURITY_OVERRIDE" = "true" ]; then
|
|
37
|
+
# OpenCode Security is controlled only by the repository or
|
|
38
|
+
# organization variable. An unset value is disabled.
|
|
39
|
+
if [ "$OPENCODE_SECURITY" = "true" ]; then
|
|
46
40
|
enabled=true
|
|
47
|
-
|
|
48
|
-
enabled=false
|
|
49
|
-
elif grep -Eq '^opencode_security:\s*(true|auto)\s*$' .github/code-foundry.yml 2>/dev/null; then enabled=true; fi
|
|
41
|
+
fi
|
|
50
42
|
if [ -n "$OPENCODE_API_KEY" ]; then token=true; fi
|
|
51
43
|
echo "enabled=$enabled" >> "$GITHUB_OUTPUT"
|
|
52
44
|
echo "token=$token" >> "$GITHUB_OUTPUT"
|
|
@@ -101,9 +101,9 @@ jobs:
|
|
|
101
101
|
releaseType = fs.existsSync('package.json') ? 'node' : fs.existsSync('pyproject.toml') ? 'python' : fs.existsSync('Cargo.toml') ? 'rust' : fs.existsSync('version.txt') ? 'simple' : 'none'
|
|
102
102
|
}
|
|
103
103
|
if (!['node', 'python', 'rust', 'simple', 'none'].includes(releaseType)) throw new Error(`Unsupported release_type: ${releaseType}`)
|
|
104
|
-
const allowedStrategies = gitWorkflow === 'staging-release' ? ['rebase'] : ['
|
|
104
|
+
const allowedStrategies = gitWorkflow === 'staging-release' ? ['rebase'] : ['squash']
|
|
105
105
|
if (!allowedStrategies.includes(releaseMergeStrategy)) {
|
|
106
|
-
throw new Error(`release_merge_strategy must be "
|
|
106
|
+
throw new Error(`release_merge_strategy must be "${gitWorkflow === 'staging-release' ? 'rebase' : 'squash'}" for automated release merges; got ${releaseMergeStrategy || '(unset; release automation never defaults to merge)'}`)
|
|
107
107
|
}
|
|
108
108
|
if (releaseType === 'none' || !fs.existsSync('package.json')) npmPublish = 'false'
|
|
109
109
|
let legacyReleaseType = ''
|
|
@@ -218,9 +218,13 @@ jobs:
|
|
|
218
218
|
for pr in "${release_prs[@]}"; do
|
|
219
219
|
PR_DRAFT=$(gh pr view "$pr" --repo "$GITHUB_REPOSITORY" --json isDraft --jq '.isDraft')
|
|
220
220
|
if [ "$AUTO_MERGE" = true ]; then
|
|
221
|
-
if [ "$PR_DRAFT" =
|
|
222
|
-
|
|
221
|
+
if [ "$PR_DRAFT" = false ]; then
|
|
222
|
+
# A Release Please PR can be updated while already ready. Reset
|
|
223
|
+
# it so ready_for_review always starts validation for the exact
|
|
224
|
+
# current release head.
|
|
225
|
+
gh pr ready --undo "$pr" --repo "$GITHUB_REPOSITORY"
|
|
223
226
|
fi
|
|
227
|
+
gh pr ready "$pr" --repo "$GITHUB_REPOSITORY"
|
|
224
228
|
else
|
|
225
229
|
if [ "$PR_DRAFT" = false ]; then
|
|
226
230
|
gh pr ready --undo "$pr" --repo "$GITHUB_REPOSITORY"
|
|
@@ -99,7 +99,7 @@ jobs:
|
|
|
99
99
|
env:
|
|
100
100
|
REPO_FOUNDRY_PRIVATE: ${{ github.event.repository.private }}
|
|
101
101
|
REPO_FOUNDRY_VISIBILITY: ${{ github.event.repository.visibility }}
|
|
102
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs security profile >> "$GITHUB_OUTPUT"
|
|
102
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" security profile >> "$GITHUB_OUTPUT"
|
|
103
103
|
- id: matrix
|
|
104
104
|
name: Build audit matrix
|
|
105
105
|
env:
|
|
@@ -268,21 +268,24 @@ jobs:
|
|
|
268
268
|
esac
|
|
269
269
|
fi
|
|
270
270
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
271
|
+
{
|
|
272
|
+
printf 'toolchain_mode=%s\n' "$toolchain"
|
|
273
|
+
printf 'package_manager=%s\n' "$package_manager"
|
|
274
|
+
printf 'mise_tools=%s\n' "$mise_tools"
|
|
275
|
+
} >> "$GITHUB_OUTPUT"
|
|
274
276
|
- name: Detect JavaScript
|
|
275
277
|
id: applicability-javascript
|
|
276
278
|
if: matrix.entry.language == 'javascript'
|
|
277
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs security should_run javascript >> "$GITHUB_OUTPUT"
|
|
279
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" security should_run javascript >> "$GITHUB_OUTPUT"
|
|
278
280
|
- name: Detect Rust
|
|
279
281
|
id: applicability-rust
|
|
280
282
|
if: matrix.entry.language == 'rust'
|
|
281
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs security should_run rust >> "$GITHUB_OUTPUT"
|
|
283
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" security should_run rust >> "$GITHUB_OUTPUT"
|
|
282
284
|
- name: Setup mise toolchain
|
|
283
285
|
if: steps.audit-toolchain.outputs.mise_tools != ''
|
|
284
286
|
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4
|
|
285
287
|
with:
|
|
288
|
+
version: 2026.9.2
|
|
286
289
|
cache: false
|
|
287
290
|
install_args: ${{ steps.audit-toolchain.outputs.mise_tools }}
|
|
288
291
|
- name: Setup Node
|
|
@@ -316,7 +319,7 @@ jobs:
|
|
|
316
319
|
if: >-
|
|
317
320
|
matrix.entry.language == 'javascript' &&
|
|
318
321
|
steps.applicability-javascript.outputs.applicable == 'true'
|
|
319
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs security audit javascript
|
|
322
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" security audit javascript
|
|
320
323
|
- name: Check Rust
|
|
321
324
|
id: system-rust
|
|
322
325
|
if: >-
|
|
@@ -349,7 +352,7 @@ jobs:
|
|
|
349
352
|
if: >-
|
|
350
353
|
matrix.entry.language == 'rust' &&
|
|
351
354
|
steps.applicability-rust.outputs.applicable == 'true'
|
|
352
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs security audit rust
|
|
355
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" security audit rust
|
|
353
356
|
- name: Setup Python
|
|
354
357
|
if: >-
|
|
355
358
|
matrix.entry.language == 'python' &&
|
|
@@ -375,4 +378,4 @@ jobs:
|
|
|
375
378
|
enable-cache: false
|
|
376
379
|
- name: Audit Python dependencies
|
|
377
380
|
if: matrix.entry.language == 'python'
|
|
378
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs security audit python
|
|
381
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" security audit python
|
|
@@ -86,7 +86,7 @@ jobs:
|
|
|
86
86
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
87
87
|
- name: Detect
|
|
88
88
|
id: applicability
|
|
89
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci task_profile unit >> "$GITHUB_OUTPUT"
|
|
89
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci task_profile unit >> "$GITHUB_OUTPUT"
|
|
90
90
|
- name: Setup
|
|
91
91
|
if: steps.applicability.outputs.applicable == 'true'
|
|
92
92
|
uses: ./.github/actions/setup
|
|
@@ -104,7 +104,7 @@ jobs:
|
|
|
104
104
|
task-rust: ${{ steps.applicability.outputs.rust }}
|
|
105
105
|
- name: Unit
|
|
106
106
|
if: steps.applicability.outputs.applicable == 'true'
|
|
107
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci unit
|
|
107
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci unit
|
|
108
108
|
- name: Upload coverage
|
|
109
109
|
if: >-
|
|
110
110
|
always() &&
|
|
@@ -151,7 +151,7 @@ jobs:
|
|
|
151
151
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
152
152
|
- name: Detect
|
|
153
153
|
id: applicability
|
|
154
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci task_profile performance >> "$GITHUB_OUTPUT"
|
|
154
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci task_profile performance >> "$GITHUB_OUTPUT"
|
|
155
155
|
- name: Setup
|
|
156
156
|
if: steps.applicability.outputs.applicable == 'true'
|
|
157
157
|
uses: ./.github/actions/setup
|
|
@@ -170,7 +170,7 @@ jobs:
|
|
|
170
170
|
task-rust: ${{ steps.applicability.outputs.rust }}
|
|
171
171
|
- name: Performance
|
|
172
172
|
if: steps.applicability.outputs.applicable == 'true'
|
|
173
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci performance
|
|
173
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci performance
|
|
174
174
|
- name: Upload performance results
|
|
175
175
|
if: >-
|
|
176
176
|
always() &&
|
|
@@ -216,7 +216,7 @@ jobs:
|
|
|
216
216
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
217
217
|
- name: Detect
|
|
218
218
|
id: applicability
|
|
219
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci task_profile integration >> "$GITHUB_OUTPUT"
|
|
219
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci task_profile integration >> "$GITHUB_OUTPUT"
|
|
220
220
|
- name: Setup
|
|
221
221
|
if: steps.applicability.outputs.applicable == 'true'
|
|
222
222
|
uses: ./.github/actions/setup
|
|
@@ -234,7 +234,7 @@ jobs:
|
|
|
234
234
|
task-rust: ${{ steps.applicability.outputs.rust }}
|
|
235
235
|
- name: Integration
|
|
236
236
|
if: steps.applicability.outputs.applicable == 'true'
|
|
237
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci integration
|
|
237
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci integration
|
|
238
238
|
|
|
239
239
|
e2e:
|
|
240
240
|
name: E2E
|
|
@@ -265,7 +265,7 @@ jobs:
|
|
|
265
265
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
266
266
|
- name: Detect
|
|
267
267
|
id: applicability
|
|
268
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci task_profile e2e >> "$GITHUB_OUTPUT"
|
|
268
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci task_profile e2e >> "$GITHUB_OUTPUT"
|
|
269
269
|
- name: Cache browser binaries
|
|
270
270
|
if: steps.applicability.outputs.applicable == 'true' && steps.applicability.outputs.browser == 'true'
|
|
271
271
|
uses: ./.github/actions/cache
|
|
@@ -295,7 +295,7 @@ jobs:
|
|
|
295
295
|
task-rust: ${{ steps.applicability.outputs.rust }}
|
|
296
296
|
- name: E2E
|
|
297
297
|
if: steps.applicability.outputs.applicable == 'true'
|
|
298
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci e2e
|
|
298
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci e2e
|
|
299
299
|
|
|
300
300
|
smoke:
|
|
301
301
|
name: Smoke
|
|
@@ -326,7 +326,7 @@ jobs:
|
|
|
326
326
|
cp -R "$RUNNER_TEMP/code-foundry/.github/actions/." .github/actions/
|
|
327
327
|
- name: Detect
|
|
328
328
|
id: applicability
|
|
329
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci task_profile smoke >> "$GITHUB_OUTPUT"
|
|
329
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci task_profile smoke >> "$GITHUB_OUTPUT"
|
|
330
330
|
- name: Setup
|
|
331
331
|
if: steps.applicability.outputs.applicable == 'true'
|
|
332
332
|
uses: ./.github/actions/setup
|
|
@@ -344,4 +344,4 @@ jobs:
|
|
|
344
344
|
task-rust: ${{ steps.applicability.outputs.rust }}
|
|
345
345
|
- name: Smoke
|
|
346
346
|
if: steps.applicability.outputs.applicable == 'true'
|
|
347
|
-
run: node $RUNNER_TEMP/code-foundry/src/runtime.mjs ci smoke
|
|
347
|
+
run: node "$RUNNER_TEMP/code-foundry/src/runtime.mjs" ci smoke
|
|
@@ -80,7 +80,7 @@ permissions:
|
|
|
80
80
|
jobs:
|
|
81
81
|
ci:
|
|
82
82
|
name: CI
|
|
83
|
-
if: vars.CI_BILLING_PAUSED != 'true' && (inputs.mode == 'fast' || inputs.mode == 'audit')
|
|
83
|
+
if: vars.CI_BILLING_PAUSED != 'true' && (inputs.mode == 'fast' || inputs.mode == 'audit' || inputs.mode == 'release')
|
|
84
84
|
uses: ./.github/workflows/ci.yml
|
|
85
85
|
with:
|
|
86
86
|
runtime-repository: ${{ inputs.runtime-repository }}
|
|
@@ -92,7 +92,7 @@ jobs:
|
|
|
92
92
|
|
|
93
93
|
test:
|
|
94
94
|
name: Test
|
|
95
|
-
if: vars.CI_BILLING_PAUSED != 'true' && (inputs.mode == 'fast' || inputs.mode == 'audit')
|
|
95
|
+
if: vars.CI_BILLING_PAUSED != 'true' && (inputs.mode == 'fast' || inputs.mode == 'audit' || inputs.mode == 'release')
|
|
96
96
|
uses: ./.github/workflows/test.yml
|
|
97
97
|
with:
|
|
98
98
|
runtime-repository: ${{ inputs.runtime-repository }}
|
|
@@ -106,7 +106,7 @@ jobs:
|
|
|
106
106
|
|
|
107
107
|
security:
|
|
108
108
|
name: Security
|
|
109
|
-
if: vars.CI_BILLING_PAUSED != 'true' && inputs.mode == 'audit'
|
|
109
|
+
if: vars.CI_BILLING_PAUSED != 'true' && (inputs.mode == 'audit' || inputs.mode == 'release')
|
|
110
110
|
uses: ./.github/workflows/security.yml
|
|
111
111
|
with:
|
|
112
112
|
runtime-repository: ${{ inputs.runtime-repository }}
|
|
@@ -129,9 +129,10 @@ jobs:
|
|
|
129
129
|
|
|
130
130
|
# Aggregate check: "Validation / Gate" (caller job name + this job name).
|
|
131
131
|
# Always evaluates; only jobs required for the mode must have succeeded.
|
|
132
|
-
# The release tier runs
|
|
133
|
-
#
|
|
134
|
-
#
|
|
132
|
+
# The release tier runs the full audit suite so Release Please pull requests
|
|
133
|
+
# expose no neutral suite checks. Its generated release diff policy executes
|
|
134
|
+
# as a conditional step below, so ordinary pull requests still render no
|
|
135
|
+
# skipped release-policy row.
|
|
135
136
|
gate:
|
|
136
137
|
name: Gate
|
|
137
138
|
needs: [ci, test, security, codeql]
|