Skip to content

ci: add zizmor to scan GitHub Actions workflows#10322

Draft
DmitriyLewen wants to merge 5 commits intoaquasecurity:mainfrom
DmitriyLewen:ci/add-zizmor
Draft

ci: add zizmor to scan GitHub Actions workflows#10322
DmitriyLewen wants to merge 5 commits intoaquasecurity:mainfrom
DmitriyLewen:ci/add-zizmor

Conversation

@DmitriyLewen
Copy link
Contributor

Description

Add zizmor — a static analysis tool for GitHub Actions workflows — as a CI check that runs on every PR touching .github/.

Changes

  • Add zizmor job in test.yaml scoped to .github/
  • Fix all 13 error-level findings zizmor reported on existing workflows:
    • Template injection in setup-go, trivy-triage, mkdocs-latest, release-please, release, auto-ready-for-review — replaced ${{ expr }} in run: blocks with environment variables
    • Unpinned uses in trivy-triage — pinned actions/github-script to SHA
    • Cache poisoning in release and reusable-release — suppressed with inline ignore comments (legitimate pattern: cache is keyed by github.sha)
    • Dangerous triggers in auto-ready-for-review — suppressed with inline ignore comment (intentional workflow_run use)

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Fix all 13 error-level findings reported by zizmor across .github/:

- setup-go/action.yaml: fix template-injection by moving inputs.go-version-file to env var
- trivy-triage/action.yaml: pin actions/github-script to SHA and fix template-injection
  by moving inputs.discussion_num to env var
- mkdocs-latest.yaml: fix 3 template-injection findings (github.ref, inputs.version,
  github.ref_name) by using env vars and built-in GITHUB_* variables
- release-please.yaml: fix 2 template-injection findings by moving inputs.version
  and github.ref_name to env vars
- release.yaml: fix 3 template-injection findings (github.ref_name in workflow triggers)
  and suppress cache-poisoning false positive
- reusable-release.yaml: suppress cache-poisoning false positive
- auto-ready-for-review.yaml: suppress dangerous-triggers and fix template-injection
  by moving steps.pr-context.outputs.number to env var
@DmitriyLewen DmitriyLewen self-assigned this Mar 4, 2026
interval: weekly
cooldown:
default-days: 3
default-days: 7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zizmor recommends a 7-day delay here.
Let me know if there's a specific reason you went with 3 days.

refs:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall why we have 3, I guess we can go 7.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too. There is no advantage to quickly updating dependencies.

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.

3 participants