Harden GitHub Actions with zizmor#1270
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis pull request hardens GitHub Actions workflows with explicit permission blocks and pinned action commit SHAs; it adds a Zizmor workflow and pre-commit hook to validate workflow YAML and declares zizmor as a development dependency. ChangesWorkflow Security Hardening with Zizmor Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1270 +/- ##
=======================================
Coverage 34.86% 34.86%
=======================================
Files 117 117
Lines 3029 3029
Branches 411 411
=======================================
Hits 1056 1056
Misses 1960 1960
Partials 13 13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions posture by adding zizmor (locally via pre-commit and in CI) and applying its recommended workflow security fixes (SHA pinning, tightened permissions, and safer checkout defaults), including simplifying release asset upload to use the runner’s GitHub CLI.
Changes:
- Add zizmor as a dev dependency and run it via pre-commit and a dedicated GitHub Actions workflow.
- Pin third-party actions to full commit SHAs and disable
actions/checkoutcredential persistence. - Restrict workflow
permissionsacross CI/release workflows and switch release asset upload togh release upload.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Adds zizmor to the locked dev dependency set. |
pyproject.toml |
Declares zizmor as a dev dependency. |
.pre-commit-config.yaml |
Adds a zizmor hook scoped to .github/workflows/. |
.github/workflows/zizmor.yaml |
New CI workflow to run zizmor against workflows with minimal permissions. |
.github/workflows/tests.yml |
Pins Codecov action by SHA and retains least-privilege permissions. |
.github/workflows/ruff.yaml |
Adds permissions, pins actions by SHA, and disables checkout credential persistence. |
.github/workflows/pylint.yaml |
Adds permissions, pins actions by SHA, and disables checkout credential persistence. |
.github/workflows/release.yaml |
Pins actions by SHA, disables checkout credential persistence, and uploads release assets via gh. |
.github/workflows/release-drafter.yaml |
Adds explicit permissions and pins Release Drafter action by SHA. |
.github/workflows/pr-labels.yaml |
Switches to pull_request trigger, adds explicit permissions, and pins the label verification action by SHA. |
.github/workflows/labels.yaml |
Adds explicit permissions, pins actions by SHA, and disables checkout credential persistence. |
.github/workflows/hassfest.yaml |
Adds explicit permissions, pins actions by SHA, and disables checkout credential persistence. |
.github/workflows/hacs.yaml |
Adds explicit permissions, pins actions by SHA, and disables checkout credential persistence. |
.github/workflows/documentation.yaml |
Adds explicit permissions, pins actions by SHA, and disables checkout credential persistence; keeps deploy job permissions scoped. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # pyproject.toml
|



Add zizmor to audit the GitHub Actions workflows and fix the findings it reports.
This pins the remaining actions by SHA, limits workflow permissions, disables checkout credential persistence, and removes the extra release upload action in favor of the GitHub CLI that is already available on the runner.
Checks run locally: