chore(ci): split publish from build, drop Actions cache from privileged workflows#62
Merged
Conversation
…ed workflows
Splits release.yml into two jobs to close the OIDC-theft path that the
TanStack/router compromise (2026-05-11) exploited:
- `build` job: contents: write + pull-requests: write (release-please).
Runs install/build/pack and uploads the .tgz as an artifact. NO id-token.
- `publish-npm` job: needs build, id-token: write only. Downloads the
tarball into a scratch dir and runs `npm publish --provenance`. Never
executes pnpm install or any third-party code.
JSR publish and GH pre-release stay in the build job (JSR uses its own
OIDC binding scoped to JSR, not npm).
Also drops `cache: pnpm` from docs.yml and ci.yml. Per
adnanthekhan.com/2024/05/06/the-monsters-in-your-build-cache, GitHub
Actions cache poisoning lets a compromised dep on a main-branch workflow
steal the cache token and poison entries that other privileged workflows
on main will restore. release.yml never used cache; docs.yml has
id-token: write for Pages OIDC and is the main remaining target. ci.yml
is low impact but dropped for consistency. preview-release.yml runs in
fork cache scope and is unaffected.
All `\${{ ... }}` substitutions in inline shell scripts moved to env:
blocks (GHSL Part 2 defense in depth, even though upstream values are
regex-validated).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
commit: |
staaldraad
approved these changes
May 12, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes the OIDC-theft and cache-poisoning vectors that the TanStack/router compromise (2026-05-11) and Adnan Khan's cache-poisoning research describe.
What changed
release.ymlsplit into two jobs:build—contents: write+pull-requests: write(release-please). Runs install/build/pack and uploads the.tgzas an artifact. Noid-token.publish-npm—needs: build, only job withid-token: write. Downloads the tarball into./publish/(scratch dir per GHSL Part 4), runsnpm publish --provenanceon the.tgz. Never runspnpm installor any third-party code.JSR publish and GH pre-release stay in the build job (JSR uses its own OIDC binding scoped to JSR, not npm).
Dropped
cache: pnpmfromdocs.ymlandci.yml:A compromised dep on a main-branch workflow can steal the GitHub Actions cache token and poison entries that other privileged workflows on main will restore.
release.ymlno longer caches;docs.ymlhadid-token: writefor Pages OIDC and was the main remaining target.ci.ymlis low-impact but dropped for consistency.preview-release.ymlruns in fork cache scope (forks cannot write to main's cache) and is unaffected.Defense-in-depth: moved all
${{ ... }}substitutions in inline shell scripts toenv:blocks (GHSL Part 2 pattern), even though upstream values are regex-validated.What this does NOT close
A compromised dep on the
buildjob can still corruptdist/. The poisoned artifact would then flow topublish-npmand ship with a valid OIDC token and provenance attestation. Closing this requires a required-reviewer Environment on the publish job — deferred to a follow-up.Verification
npm packproduces a 59 KB tarball with the expected contents.End-to-end verification needs a release-please cycle (open a release PR, merge, watch the two jobs).