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
2 times, most recently
from
August 5, 2026 05:26
7a0b049 to
7263854
Compare
Collaborator
|
isn't most of this https://github.com/agent-substrate/substrate/pull/657/changes? |
Author
I'll rebase |
agent-substrate#657 already pinned the actions in pr-workflow.yaml and scoped the token to contents: read, so this trims to just the zizmor findings that landing did not cover. - govulncheck.yaml: pin golang/govulncheck-action@v1 to 032d45514ae346b1db93c04b0c90b841c370344f (v1.1.0), the only remaining unpinned-uses finding. - pr-workflow.yaml: fix template-injection. Move ${{ matrix.ateapi-client-auth }} (Install / Deploy micro-VM steps) and ${{ needs.e2e-test-matrix.result }} (Check E2E matrix step) into env: vars and reference them as quoted shell variables so the expansion cannot inject code. Verified with zizmor v1.29.0: zero unpinned-uses and zero template-injection findings on both workflows. No functional change.
sanskar singh bhardwaj (sanskar-singh-2403)
force-pushed
the
ci/pin-workflow-actions
branch
from
August 6, 2026 11:06
7263854 to
420582e
Compare
Author
|
Benjamin Elder (@BenTheElder) I've reset onto current main and trimmed this down to just the findings #657
Verified with zizmor: zero unpinned-uses and zero template-injection findings. |
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.).