Pin GitHub Actions to commit SHAs + enforce in CI#65
Merged
Conversation
dist emits mutable tag pins (actions/checkout@v6, ...) in the generated release.yml. Pin all three actions to full commit SHAs for supply-chain safety, and add a `pin-check` CI job that fails if any workflow action is not SHA-pinned — which also catches a future `dist generate` reverting them. The regeneration caveat is documented in dist-workspace.toml. Co-Authored-By: Claude Opus 4.8 <[email protected]>
`dist plan` validates that release.yml matches what dist would generate and fails on the hand-pinned (commit-SHA) actions. allow-dirty = ["ci"] is dist's supported escape hatch for hand-edited CI; the pin-check job still enforces that the actions stay SHA-pinned. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
What
Pins every GitHub Action to a full 40-character commit SHA and adds a CI guard to keep it that way.
release.yml(dist-generated): pinnedactions/checkout@v6,actions/upload-artifact@v7,actions/download-artifact@v8to their commit SHAs (with# vXcomments). dist does not SHA-pin natively.ci.yml: newpin-checkjob — fails CI if anyuses:across.github/workflows/isn't a 40-char SHA (local./actions exempt).ci.yml+publish-crate.ymlwere already pinned.dist-workspace.toml: documents thatdist generate/dist initwill revertrelease.ymlto tag pins, and thatpin-checkwill catch it.Why
Mutable tags (
@v6) can be silently repointed at malicious code if an action or maintainer account is compromised. A commit SHA is immutable — the only way to use an action as an immutable release. See GitHub's guidance.Caveat (documented in
dist-workspace.toml)dist generate --checkwill now reportrelease.ymlas out of sync (it's intentionally hand-pinned). It is not run in CI, so nothing breaks — but if you regenerate the workflow, re-pin the actions;pin-checkwill flag it if you forget.Validated
yqparses all workflows ·pin-checklogic run locally → all actions SHA-pinned ✓🤖 Generated with Claude Code