Repository navigation
feat: pin third-party GitHub Actions to immutable commit SHAs - #561
Open
seuninfoo-svg wants to merge 1 commit into
Open
seuninfoo-svg wants to merge 1 commit into
seuninfoo-svg wants to merge 1 commit into
Conversation
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.
PR: Pin Third-Party GitHub Actions to Immutable Commit SHAs
Summary
Pins every third-party GitHub Action in
.github/workflows/*.ymlto a full 40-character commit SHA with a trailing comment preserving the human-readable release tag. This makes workflow dependencies immutable and auditable.Motivation
GitHub Actions referenced by moving tags (e.g.,
actions/checkout@v4) can be mutated by the action owner. Pinning to commit SHAs ensures the exact code reviewed is the code executed in CI, preventing supply-chain attacks where a compromised action publisher pushes malicious code to an existing tag.Changes
All 7 workflow files updated:
bindings-check.ymlcontract.ymlcoverage.ymldocs-links.ymlenv-examples.ymlline-lengths.ymlweb.ymluses:entries pinnedPin Mappings
actions/checkoutv411d5960a326750d5838078e36cf38b85af677262# v4actions/setup-nodev449933ea5288caeca8642d1e84afbd3f7d6820020# v4pnpm/action-setupv4f40ffcd9367d9f12939873eb1018b921a783ffaa# v4dtolnay/rust-toolchainstable683b588c487a69d01f6c6ddf40f036ff682cc2c8# stable (v1)Swatinem/rust-cachev2d1527c8f67ef9af357290475d4af4b0fab8f12e0# v2Acceptance Criteria
uses:entry pinned to 40-char commit SHA# v4,# stable (v1), or# v2uses:lines modified./path) existedVerification
Example Diff
How to Update Pins in Future
When a new version of an action is desired:
Find the commit SHA for the new tag:
Replace the SHA and update the comment in all workflow files.
Test the workflows in a branch before merging.
Related
close #481