Add zizmor pre-commit configuration#34
Open
ROHITCRAFTSYT wants to merge 1 commit into
Open
Conversation
Adds the zizmor hook to pre-commit and resolves the findings 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 checkouts, release creation via the runner's gh CLI instead of ncipollo/release-action, and a 7-day dependabot cooldown on all three ecosystems. One finding is ignored with justification rather than fixed: unpinned-images on the test matrix, because the matrix deliberately tracks rolling distro tags (archlinux:base, opensuse/tumbleweed) to test each distro's current PySide6 packages; digest-pinning would defeat that purpose. Refs beeware#33 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 #33, and fixes the findings 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,build-and-inspect-python-packagev2.18.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 those jobs 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.One deliberate exclusion (flagging for core team review, per the issue's guidance)
unpinned-images fires on
container.image: ${{ matrix.distro }}. The test matrix deliberately tracks rolling distro tags (archlinux:base,opensuse/tumbleweed,ubuntu:25.04,fedora:42) because this repo's entire purpose is testing against each distro's current system PySide6 packages — digest-pinning those images would freeze them and defeat that purpose. I've added an inline# zizmor: ignore[unpinned-images]with a justifying comment; happy to change the approach if the core team prefers digests + dependabot or a.zizmor.ymlrule instead.zizmor .github/now reports no findings (1 justified ignore), andpre-commit run --all-filespasses with the new hook.Fixes #33
PR Checklist:
Assisted-by: Claude Fable 5 (Claude Code)