ci: harden workflows for zizmor (pin actions, fix template injection) - #751
Open
sanskar singh bhardwaj (sanskar-singh-2403) wants to merge 1 commit into
Conversation
sanskar singh bhardwaj (sanskar-singh-2403)
force-pushed
the
ci/pin-workflow-actions
branch
from
August 5, 2026 05:12
5cbd4ea to
5da4d6a
Compare
sanskar singh bhardwaj (sanskar-singh-2403)
force-pushed
the
ci/pin-workflow-actions
branch
from
August 5, 2026 05:20
5da4d6a to
7a0b049
Compare
The repo's zizmor gate enforces a blanket policy requiring every GitHub Actions `uses:` reference to be pinned to a full commit SHA rather than a floating tag. pr-workflow.yaml referenced three actions by major-version tag in five places, failing the mandatory unpinned-uses check. Pin each to the exact commit its tag currently resolves to, keeping the semver in a trailing comment so Dependabot and humans still see the version: actions/checkout@v5 -> fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 (v5.1.0) actions/setup-go@v5 -> 40f1582b2485089dde7abd97c1529aa768e1baff (v5.6.0) actions/cache@v4 -> 0057852bfaa89a56745cba8c7296529d2fc39830 (v4.3.0) No behavior change; the pinned commits are the current tips of those tags.
sanskar singh bhardwaj (sanskar-singh-2403)
force-pushed
the
ci/pin-workflow-actions
branch
from
August 5, 2026 05:26
7a0b049 to
7263854
Compare
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 PR does / why we need it
The zizmor gate has two mandatory checks failing on the workflow files:
unpinned-usesandtemplate-injection. This PR resolves both.Pin every GitHub Actions
uses:reference to a full commit SHA, keepingthe semver in a trailing comment for readability and Dependabot:
Fix template injection in pr-workflow.yaml:
${{ matrix.auth-mode }}and${{ needs.e2e-test-matrix.result }}were interpolated directly intorun:shell blocks. Move each into an
env:var and reference it as a quotedshell variable so the expansion cannot inject code.
No functional behavior change.
Testing
zizmor --persona=pedanticon both workflow files: zero findings for anymandatory check (unpinned-uses, template-injection, etc.).