Skip to content

feat: add zizmor for GitHub Actions security#798

Open
henryiii wants to merge 1 commit into
mainfrom
henryiii/feat/zizmor
Open

feat: add zizmor for GitHub Actions security#798
henryiii wants to merge 1 commit into
mainfrom
henryiii/feat/zizmor

Conversation

@henryiii

@henryiii henryiii commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Adds zizmor (GitHub Actions static analysis) across the three concerns of this repo.

repo-review

  • New GH106 check: passes when the project uses the zizmor-pre-commit hook or the zizmorcore/zizmor-action in a workflow. Requires GH100. Added tests and regenerated the README check list.

Guide

  • New "Linting your workflows" section in gha_basic.md (with the GH106 badge), covering the pre-commit hook, # zizmor: ignore / zizmor.yml, and the GitHub Action.
  • gha_basic.md is now included in the pc_bump nox session so the hook rev stays maintained.

Cookiecutter template

  • Adds the zizmor pre-commit hook to .pre-commit-config.yaml (GitHub-CI projects only).
  • Adds .github/zizmor.yml (GitHub-CI projects only) that disables the unpinned-uses audit (sets *: ref-pin), since the template is maintained via Dependabot tags rather than hash pins.
  • Makes the generated workflows zizmor-clean so the lint job passes out of the box:
    • top-level permissions: {} + per-job contents: read (excessive-permissions)
    • persist-credentials: false on all checkouts (artipacked)
    • enable-cache: false on setup-uv in the wheel-building cd.yml (cache-poisoning on a release workflow)

This repo itself

GH106 is added to [tool.repo-review.ignore] (with a reason, like the existing RTD103) so repo-review . stays green. Full zizmor adoption for this repo's own 8 workflows (dangerous-triggers, github-app, etc.) is left as a follow-up.

Validation

  • Rendered pure + compiled + vcs=false projects all report "No findings" from zizmor.
  • compare_copier confirms cookiecutter/copier produce identical files (including the new zizmor.yml).
  • prek -a clean; full test suite passes.

📚 Documentation preview 📚: https://scientific-python-cookie--798.org.readthedocs.build/

Add zizmor (GitHub Actions static analysis) across the three concerns:

- repo-review: new GH106 check (uses the zizmor pre-commit hook or the
  zizmor-action), with tests and regenerated README.
- guide: new "Linting your workflows" section in gha_basic.md; the page is
  now bumped by the pc_bump nox session.
- cookiecutter: add the zizmor pre-commit hook and a .github/zizmor.yml
  (GitHub-CI projects only) that relaxes unpinned-uses to ref-pin so the
  template stays maintainable via Dependabot. The generated workflows are
  made zizmor-clean (top-level permissions, persist-credentials: false,
  enable-cache: false on the wheel build).

GH106 is ignored for this repo's own workflows for now.

Assisted-by: ClaudeCode:claude-opus-4.8
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