ci: pin actions to commit SHAs and the publish npm CLI to an exact version - #207
Conversation
…rsion The release job holds `id-token: write` and ran two mutable refs inside it: `googleapis/release-please-action@v5` and `npx -y npm@latest`. A re-pointed upstream tag or a compromised npm release would have executed with the Trusted Publisher credential live. Every other third-party action in the repo was on a major tag as well. Every `uses:` outside the local composite action now names a full commit SHA, with the release version in a trailing comment so Dependabot keeps updating both. Each SHA is what its major tag resolved to at the time of the change, so no action version moves. The npm CLI is pinned to 12.0.2, which is what `latest` already resolved to for the last two releases. Dependabot does not track that line, so the workflow comment says to bump it by hand. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TSGLfzCh5VJAikAXtEdoxt
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
block-kitchen | f59862f | Commit Preview URL Branch Preview URL |
Sep 03 2026, 09:47 PM |
Cloudflare preview✅ Deployed |
|
Audit (pnpm) is red on this head, and the failure is not this PR's. The check fails on four high advisories against No open PR carries a fix yet. The fix is lockfile-only: the patched release is within ajv's declared range, so no produces this diff, which audits clean ( - fast-uri@3.1.5:
- resolution: {integrity: sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==}
+ fast-uri@3.1.7:
+ resolution: {integrity: sha512-dOvZVzjdZdz7phd9v6jCbwxrBW3fK6n8Rc0CtdmM4bumzMnxywBYhuph6J819RRw/ku+rLbelwfMunktuzVVHg==}
...
ajv@8.20.0:
dependencies:
fast-deep-equal: 3.1.3
- fast-uri: 3.1.5
+ fast-uri: 3.1.7
...
- fast-uri@3.1.5: {}
+ fast-uri@3.1.7: {}I have kept it out of this PR so the diff stays the pinning change. It can land on Generated by Claude Code |
Summary
Every third-party GitHub Action is now referenced by full commit SHA, with the release version in a trailing comment so Dependabot keeps updating both, and the publish step runs
npx -y npm@12.0.2instead ofnpm@latest.Why
The release job holds
id-token: write, and two mutable refs executed inside it:googleapis/release-please-action@v5andnpx -y npm@latest. A re-pointed upstream tag or a compromised npm CLI release would run with the Trusted Publisher credential live and could publish as us, or alter the tarball before it reaches the registry. The other workflows were on major tags too (nine distinct refs in total), which is the same exposure with less at stake, so they are pinned in the same pass.Test plan
uses:outside./.github/actions/setupis a 40-hex SHAgit ls-remoteagainst the upstream repos and peeled through annotated tags, so no action version changesnpm@12.0.2is whatnpm@latestalready resolved to for the 0.10.12 and 0.10.13 publishes on 2026-09-01, so the publish step's behavior is unchangedpnpm typecheck/pnpm lint/pnpm testnot run: no source files change, and biome'sfiles.includesdoes not cover.github/or Markdown. CI on this PR exercises the pinnedci.ymlandcodeql.ymldirectly.release-please.ymlpublish step only runs on a release frommain, so the pinned npm version is first exercised by the next release.Notes for reviewer
pnpm/action-setup@v4currently resolves to v4.3.0 upstream even though a v4.4.0 tag exists, so the pin is v4.3.0 to match what runs today. Dependabot's nextgithub-actionspass should propose v4.4.0 as a minor bump.sha # vX.Y.Zpins and updates both parts. It does not track theNPM_VERSIONenv inrelease-please.yml; the workflow comment says to bump it by hand.SECURITY-REVIEW.mdrecord that Info-002 (action SHA pinning) is done.🤖 Generated with Claude Code
https://claude.ai/code/session_01TSGLfzCh5VJAikAXtEdoxt
Generated by Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.