Repository navigation
fix(automation): bind commercial writer toolchain #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
51f2ed1
test(automation): require exact writer toolchain
seonghobae aacaf6b
fix(automation): bind commercial writer toolchain
seonghobae 8f43c23
test(automation): mint write token after install
seonghobae 0f83023
fix(automation): defer write token mint until after install
seonghobae 64f5c4a
test(automation): bind toolchain checks to exact workflow steps
seonghobae a060018
test(automation): require retained no-PR evidence
seonghobae aa10ed6
fix(automation): fail closed on missing no-PR evidence
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
test/hourly-commercial-readiness-toolchain-integrity.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { readFileSync } from "node:fs"; | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| const workflow = readFileSync( | ||
| ".github/workflows/hourly-commercial-readiness.yml", | ||
| "utf8", | ||
| ); | ||
|
|
||
| describe("commercial writer toolchain integrity", () => { | ||
| it("uses the exact protected-CI Node/npm execution contract", () => { | ||
| expect(workflow).toContain( | ||
| "uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0", | ||
| ); | ||
| expect(workflow).toContain('node-version: "24.19.0"'); | ||
| expect(workflow).toContain('test "$(node --version)" = "v24.19.0"'); | ||
| expect(workflow).toContain('test "$(npm --version)" = "11.17.0"'); | ||
| expect(workflow).toContain( | ||
| "npm ci --legacy-peer-deps=false --install-links=false", | ||
| ); | ||
| expect(workflow).not.toContain('node-version: "24"'); | ||
| expect(workflow).not.toMatch(/run:\s+npm ci\s*(?:\n|$)/); | ||
| }); | ||
|
|
||
| it("installs dependencies before minting write-capable App credentials", () => { | ||
| const installIndex = workflow.indexOf( | ||
| "npm ci --legacy-peer-deps=false --install-links=false", | ||
| ); | ||
| const mintIndex = workflow.indexOf("- name: mint dedicated maintainer App token"); | ||
| expect(installIndex).toBeGreaterThan(-1); | ||
| expect(mintIndex).toBeGreaterThan(-1); | ||
| expect(installIndex).toBeLessThan(mintIndex); | ||
| }); | ||
|
|
||
| it("retains credential isolation and bounded maintainer authority", () => { | ||
| expect(workflow).toContain("persist-credentials: false"); | ||
| expect(workflow).toContain( | ||
| "uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0", | ||
| ); | ||
| expect(workflow).toContain("GH_TOKEN: ${{ steps.maintainer_app.outputs.token }}"); | ||
| expect(workflow).not.toContain("GH_TOKEN: ${{ github.token }}"); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.