Skip to content

ci: add Zizmor pre-commit hook#1408

Open
HastD wants to merge 1 commit intotopgrade-rs:mainfrom
HastD:zizmor
Open

ci: add Zizmor pre-commit hook#1408
HastD wants to merge 1 commit intotopgrade-rs:mainfrom
HastD:zizmor

Conversation

@HastD
Copy link
Copy Markdown
Contributor

@HastD HastD commented Nov 1, 2025

Zizmor can flag many common security issues using static analysis of CI workflows. See https://docs.zizmor.sh/ for documentation.

@HastD HastD force-pushed the zizmor branch 2 times, most recently from 46d7d92 to f0ba330 Compare November 1, 2025 19:20
@github-advanced-security
Copy link
Copy Markdown
Contributor

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment thread .github/workflows/release-plz.yml
@GideonBear
Copy link
Copy Markdown
Member

GideonBear commented Nov 2, 2025

I have zizmor on my list of pre-commit hooks to add:

- repo: https://github.com/zizmorcore/zizmor-pre-commit
  rev: v1.9.0
  hooks:
    - id: zizmor

Is there a big advantage to using it in a workflow?

@GideonBear
Copy link
Copy Markdown
Member

In any case (workflow or pre-commit), you're welcome to create a PR with fixes (without adding zizmor)

@HastD
Copy link
Copy Markdown
Contributor Author

HastD commented Nov 2, 2025

Is there a big advantage to using it in a workflow?

I think the advantage is just that the workflow integrates with GitHub advanced security, so the recommendations show up in PR annotations and in the repo's "security" tab.

@GideonBear
Copy link
Copy Markdown
Member

I've decided on using zizmor via pre-commit, for the following reasons:

  1. Using it as a workflow spins up a whole runner, even when no workflow files are actually edited
  2. With pre-commit, it is also easily ran locally
  3. I would like to put everything I can into pre-commit, just to keep things clean.

Feel free to edit this PR, and make it as pedantic and annoying as possible please ;)

@HastD HastD changed the title ci: add Zizmor for static analysis of GitHub actions ci: add Zizmor pre-commit hook Nov 6, 2025
Zizmor can flag many common security issues using static analysis of CI
workflows. See https://docs.zizmor.sh/ for documentation.
@HastD
Copy link
Copy Markdown
Contributor Author

HastD commented Nov 6, 2025

@GideonBear Okay, I added a Zizmor pre-commit hook with --persona=auditor, the most pedantic mode of operation. Note that this may sometimes have false positives.

barkleesanders added a commit to barkleesanders/topgrade that referenced this pull request Mar 8, 2026
…opgrade-rs#1408)

Add the zizmor pre-commit hook to scan GitHub Actions workflows for
security issues. Configured with --persona=auditor for thorough
analysis and --no-progress for cleaner CI output.

Based-on-PR: topgrade-rs#1408
Original-author: Daniel Hast <daniel@danielhast.com>

Co-Authored-By: Claude Opus 4.6 <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.

3 participants