ci: pin actions to SHAs with version comments - #2
Open
GoldenSis wants to merge 1 commit into
Open
Conversation
Pin the three actions in test.yml to full commit SHAs with a version comment, so the workflow is reproducible and Dependabot can still see which release each pin corresponds to. Same major for each action -- no behaviour change: actions/checkout@v4 -> 11d5960a... # v4.4.0 actions/setup-python@v5 -> a26af69b... # v5.6.0 actions/setup-node@v4 -> 49933ea5... # v4.4.0 zizmor drops from 5 findings (3 high) to 2 (0 high).
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 this does
Pins the three actions in
.github/workflows/test.ymlto full commit SHAs, each with the version comment so the release stays readable and Dependabot can still offer a bump.Same major for each —
v4resolves to v4.4.0 today, so this is the tag you are already running, written down. No workflow logic changed.Why
A floating tag is mutable.
actions/checkout@v4is whatever thev4tag points at when the job starts, so what CI executes can change without any commit here. That is the supply-chain path behind GHSA-mrrh-fwg8-r2c3 (tj-actions/changed-files, 2025-03-15, high): tags were repointed at a malicious commit, and every workflow tracking a tag ran it on the next run and leaked secrets into its logs.The version comment matters as much as the SHA. Without it a reader cannot tell what
11d5960a…is, and Dependabot'sgithub-actionsecosystem needs the comment to know the current version before it can propose an update — a bare SHA is frozen rather than maintained.Evidence
Every check in
test.ymlrun locally on this branch, macOS / Python 3.13:The three
highfindings were the threeunpinned-uses.Generated with
pinact run(v4.1.1) rather than by hand, and verified with--min-age 7so no pin points at a release younger than a week.One follow-up I left out
There is no
.github/dependabot.yml. Adding one for thegithub-actionsecosystem would keep these pins moving on their own instead of ageing in place — happy to open it separately if you want it, but it is a different change and this PR is meant to be one thing.