Skip to content

ci: harden workflows for zizmor (pin actions, fix template injection) - #751

Open
sanskar singh bhardwaj (sanskar-singh-2403) wants to merge 1 commit into
agent-substrate:mainfrom
sanskar-singh-2403:ci/pin-workflow-actions
Open

ci: harden workflows for zizmor (pin actions, fix template injection)#751
sanskar singh bhardwaj (sanskar-singh-2403) wants to merge 1 commit into
agent-substrate:mainfrom
sanskar-singh-2403:ci/pin-workflow-actions

Conversation

@sanskar-singh-2403

@sanskar-singh-2403 sanskar singh bhardwaj (sanskar-singh-2403) commented Aug 5, 2026

Copy link
Copy Markdown

What this PR does / why we need it

The zizmor gate has two mandatory checks failing on the workflow files:
unpinned-uses and template-injection. This PR resolves both.

  1. Pin every GitHub Actions uses: reference to a full commit SHA, keeping
    the semver in a trailing comment for readability and Dependabot:

    • actions/checkout@v5 -> fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 (v5.1.0)
    • actions/setup-go@v5 -> 40f1582b2485089dde7abd97c1529aa768e1baff (v5.6.0)
    • actions/cache@v4 -> 0057852bfaa89a56745cba8c7296529d2fc39830 (v4.3.0)
    • golang/govulncheck-action@v1 -> 032d45514ae346b1db93c04b0c90b841c370344f (v1.1.0)
  2. Fix template injection in pr-workflow.yaml: ${{ matrix.auth-mode }} and
    ${{ needs.e2e-test-matrix.result }} were interpolated directly into run:
    shell blocks. Move each into an env: var and reference it as a quoted
    shell variable so the expansion cannot inject code.

No functional behavior change.

Testing

  • Ran zizmor --persona=pedantic on both workflow files: zero findings for any
    mandatory check (unpinned-uses, template-injection, etc.).
  • Confirmed both workflows remain valid YAML.

@sanskar-singh-2403 sanskar singh bhardwaj (sanskar-singh-2403) changed the title ci: pin workflow actions to commit SHAs (zizmor unpinned-uses) ci: harden workflows for zizmor (pin actions, fix template injection) Aug 5, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant