Add zizmor pre-commit configuration#71
Open
ROHITCRAFTSYT wants to merge 1 commit into
Open
Conversation
Adds the zizmor hook to pre-commit and resolves every finding it reports on the existing workflows: hash-pin all action and reusable-workflow references (beeware/.github pinned to current main), explicit least-privilege permissions on every workflow/job (release.yml's ci job forwards id-token/attestations for package attestation), persist-credentials: false on the CI checkout, release creation via the runner's gh CLI instead of ncipollo/release-action, and a 7-day dependabot cooldown on all three ecosystems. Refs beeware#70 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds zizmor to the pre-commit pipeline, as requested in #70, and fixes every finding it reports on the existing GitHub Actions configuration. Follows the approach of beeware/.github#378.
Changes
.pre-commit-config.yaml: add thezizmorhook (v1.27.0).checkoutv7.0.0,setup-pythonv6.3.0,download-artifactv8.0.1,add-to-projectv2.0.0,fetch-gh-release-asset1.1.2,gh-action-pypi-publishrelease/v1 head, andbeeware/.githubpinned to currentmain, 741cc5a).permissions:on every workflow/job;release.yml'scijob explicitly forwardsid-token: write+attestations: writeso package attestation keeps working;new-issue.ymlgetspermissions: {}since it authenticates withBRUTUS_PAT_TOKEN.persist-credentials: false; nothing in that job pushes.ghCLI (gh release create --draft --verify-tag dist/*) instead ofncipollo/release-action— same draft release with artifacts, and the step still fails if an artifact upload fails. Happy to revert this piece if you'd rather keep the action.zizmor .github/now reports no findings, andpre-commit run --all-filespasses with the new hook.Fixes #70
PR Checklist:
Assisted-by: Claude Fable 5 (Claude Code)