ci: pin validation.yaml actions so zizmor stops failing every PR - #652
ci: pin validation.yaml actions so zizmor stops failing every PR#652kalenkevich wants to merge 1 commit into
Conversation
validation.yaml still references actions/checkout, setup-node and setup-python by tag. zizmor treats unpinned-uses as a mandatory check, so the zizmor-output gate fails on every pull request that does not itself touch this file — the finding is in the base branch, not in the PR. Pin all three to the commit hash for the tag they already used, add the read-only `contents` permission for the job, and turn off credential persistence on checkout. The same hunk is currently carried by #634; splitting it out so it can land on its own and unblock the other open PRs.
AmaadMartin
left a comment
There was a problem hiding this comment.
This PR is fully redundant: #648 landed the identical validation.yaml hunk as 82c7b600, 12 minutes before you opened this one. I checked all three pinned SHAs against the upstream tag refs and they match, but they already sit on main at lines 23, 28 and 31. A simulated merge into main returns main's tree unchanged, so please close this PR.
| permissions: | ||
| contents: read | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@v6 | ||
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
There was a problem hiding this comment.
Not a nit. Main already carries this exact change, so this PR is a no-op.
PR #648 merged as 82c7b600 12 minutes before you opened this one. Its validation.yaml hunk is byte-identical to yours: the same three SHAs, the same permissions: contents: read, and the same persist-credentials: false. Main today, at lines 23, 28 and 31:
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0Your branch point 5742875d predates that merge, so the diff still displays. git merge-tree 82c7b600 19aa8ee returns main's tree unchanged. Please close this PR.
|
Based on Amaad's comments, I checked the current validation.yaml and saw they are already pinned. I'm closing this PR without merging. |
Link to Issue or Description of Change
2. Or, if no issue exists, describe the change:
Problem:
The
zizmor-outputgate fails on every pull request, including ones thattouch no workflow file at all:
validation.yamlonmainstill references three actions by tag, andunpinned-usesis one of zizmor's mandatory checks. Because the finding livesin the base branch rather than in the diff, an author gets a red required check
for something they did not write and cannot fix from their own branch.
Solution:
Pin
actions/checkout,actions/setup-nodeandactions/setup-pythonto thecommit hash of the tag each one already referenced, add the read-only
contentspermission to the job, and setpersist-credentials: falseoncheckout.
The hashes were verified against the upstream tags:
actions/checkoutd23441a48e516b6c34aea4fa41551a30e30af803actions/setup-node249970729cb0ef3589644e2896645e5dc5ba9c38actions/setup-pythona26af69be951a213d495a4c3e4e4022e16d87065This is the same hunk #634 currently carries. Splitting it out so it can land on
its own and unblock the other open PRs; #634 can drop its copy once this merges.
Testing Plan
Unit Tests:
No unit tests: this changes CI configuration only, with no runtime code in the
diff. The proof is this PR's own
zizmor-outputcheck going green while thesame check is red on #650 and #651, which branch from the same base and touch
no workflow file.
Manual End-to-End (E2E) Tests:
zizmor could not be run locally — the pinned build resolves through an internal
index that needs credentials:
So verification is CI-side. The change is byte-identical to the hunk already
passing zizmor on #634, and the version-to-hash mapping was checked against the
GitHub API for all three actions.
Checklist
Additional context
Noticed while checking CI on #650 and #651, two workflow fixes from a bug bash
of the graph-workflow docs samples. Both are red on
zizmor-outputpurelybecause of this base-branch finding.
Generated with CloudCode, session
ses_00c664b88ffeuSsmLI4zfs0a3q.