Skip to content

Add zizmor static analysis gate for GitHub Actions workflows - #78

Open
michaelpeterswa wants to merge 7 commits into
mainfrom
feat/zizmor-ci-gate
Open

Add zizmor static analysis gate for GitHub Actions workflows#78
michaelpeterswa wants to merge 7 commits into
mainfrom
feat/zizmor-ci-gate

Conversation

@michaelpeterswa

@michaelpeterswa michaelpeterswa commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a zizmor.yml CI workflow that runs zizmorcore/zizmor-action@v0.6.3 against .github/workflows/** on pushes to main and on pull requests that touch workflow files.
  • Reports findings as GitHub Actions annotations (--format=github), not SARIF/code scanning. Most consumer repos of this template repo are private and don't have a GitHub Advanced Security license, so we're standardizing on the format that works everywhere rather than a public-repo-only path.
  • continue-on-error: true is set on the zizmor step, temporarily. The github annotation format propagates zizmor's real exit code (unlike SARIF, which always exits 0), and this repo currently has real high-severity findings tracked in Adopt zizmor for static analysis of GitHub Actions workflows #76. Once that cleanup lands, we'll remove continue-on-error so the check actually blocks merges.
  • Both actions/checkout and zizmor-action are pinned to commit SHAs.
  • First step of the plan in Adopt zizmor for static analysis of GitHub Actions workflows #76.

Test plan

Part of #76.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

michaelpeterswa added a commit that referenced this pull request Sep 1, 2026
-f/--raw-field only accepts literal string values; -F/--field is
required for the "@<path>" file-read syntax. The lowercase flag was
posting the literal string "@/tmp/zizmor_comment.md" as the comment
body instead of its contents, caught by testing the update path on
PR #78.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🌈 zizmor findings

Found 203 finding(s) across the workflows in this PR.

Rule Severity Count
unpinned-uses High 120
template-injection High 22
cache-poisoning High 1
artipacked Medium 25
template-injection Medium 12
archived-uses Medium 3
adhoc-packages Low 11
artipacked Low 8
template-injection Low 1

See the zizmor job run for details, or the audit docs.

@Kochava Kochava deleted a comment from github-actions Bot Sep 1, 2026
michaelpeterswa and others added 7 commits September 1, 2026 11:51
Runs zizmorcore/zizmor-action on PRs and pushes to main that touch
.github/workflows/**, uploading results to code scanning. First step
toward the cleanup tracked in #76.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
SARIF/code scanning requires a GitHub Advanced Security license, which
most private consumer repos don't have. Standardize on the `github`
annotation format so this workflow behaves identically everywhere it's
adopted. Drops the now-unused security-events permission.

The annotation format propagates zizmor's real exit code (unlike SARIF,
which always exits 0), so continue-on-error is added temporarily until
the findings tracked in #76 are cleaned up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Annotations land on individual lines and are easy to miss, so add a
second job that runs zizmor a second time for JSON output, builds a
rule/severity breakdown, and posts (or updates, keyed on a marker
comment) a single summary comment on the PR.

Split into its own job with only the permissions it needs
(pull-requests: write) rather than granting that at the workflow
level, per zizmor's own excessive-permissions finding on the first
draft of this change. Also adds a concurrency group and explanatory
comments on the remaining permissions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
-f/--raw-field only accepts literal string values; -F/--field is
required for the "@<path>" file-read syntax. The lowercase flag was
posting the literal string "@/tmp/zizmor_comment.md" as the comment
body instead of its contents, caught by testing the update path on
PR #78.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Order rows high -> low severity, breaking ties by finding count
descending, instead of count alone. Makes the highest-risk rows
easiest to spot at the top of the table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

2 participants