Skip to content

ci: add zizmor pre-commit hook and harden workflows#1437

Open
adRn-s wants to merge 1 commit into
4.0.0from
ci/zizmor-workflow-hardening
Open

ci: add zizmor pre-commit hook and harden workflows#1437
adRn-s wants to merge 1 commit into
4.0.0from
ci/zizmor-workflow-hardening

Conversation

@adRn-s

@adRn-s adRn-s commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Adds zizmor as a pre-commit hook and applies its fixes to the GitHub Actions workflows.

Changes

  • Add zizmor pre-commit hook (.pre-commit-config.yaml), pinned to v1.11.0.
  • Pin all actions to commit SHAs with version comments (unpinned-uses, 35 findings).
  • persist-credentials: false on all actions/checkout steps so the token isn't left in .git/config (artipacked, 10 findings).
  • Minimal top-level permissions: contents: read on pypi.yml, test_planemo.yml, test_pytest.yml, test_rust.yml (excessive-permissions, 9 findings). wheels.yml already had one.

Result

zizmor went from 38 findings (19 medium, 10 high) to 0 errors/warnings. One informational finding remains: use-trusted-publishing in pypi.yml, which requires PyPI-side OIDC setup and was intentionally left out of this PR.

- Add zizmor pre-commit hook (.pre-commit-config.yaml)
- Pin all GitHub Actions to commit SHAs (unpinned-uses)
- Add persist-credentials: false to checkout steps (artipacked)
- Add minimal top-level permissions to workflows (excessive-permissions)
@adRn-s adRn-s requested a review from WardDeb July 14, 2026 14:11
@adRn-s

adRn-s commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

I didn't dare to push other hooks from template-py (i.e. ruff) but certainly it would be nice-to-have

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