Add zizmor pre-commit configuration#96
Open
ROHITCRAFTSYT wants to merge 3 commits into
Open
Conversation
Adds the zizmor hook to pre-commit and resolves every finding it reports on the existing workflows: * unpinned-uses: all action and reusable-workflow references are pinned to full commit hashes (beeware/.github is pinned to current main; dependabot will propose updates). * excessive-permissions: explicit least-privilege permissions on every workflow/job; new-issue.yml runs with no token permissions since it authenticates via BRUTUS_PAT_TOKEN. * secrets-inherit: dependabot-changenote.yml now passes BRUTUS_PAT_TOKEN explicitly instead of inheriting all secrets. * artipacked: CI checkout no longer persists credentials. * dependabot-cooldown: 7-day cooldown on all three ecosystems, matching beeware/.github#378 (also resolves beeware#94). Refs beeware#95 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With an explicit workflow-level 'permissions: contents: read', the towncrier-run reusable workflow's request for pull-requests: write exceeded the caller's grant, which GitHub rejects at workflow startup (CI failed with 'no jobs were run'). Mirror the called workflow's declared permissions on the calling job, as already done for dependabot-changenote. 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 #95, 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).actions/checkoutv7.0.0,actions/upload-artifactv7.0.1,actions/add-to-projectv2.0.0, andbeeware/.githubpinned to currentmain, 741cc5a).permissions:everywhere —contents: readfor CI and the PR-template check;permissions: {}fornew-issue.yml(it authenticates withBRUTUS_PAT_TOKEN, so the job's ownGITHUB_TOKENneeds nothing);contents: read+pull-requests: writefor the changenote workflow, mirroring what the reusable workflow declares.dependabot-changenote.ymlpassesBRUTUS_PAT_TOKENexplicitly instead ofsecrets: inherit(the reusable workflow declares it as a required secret).persist-credentials: false; nothing in that job pushes.zizmor .github/now reports no findings, andpre-commit run --all-filespasses with the new hook.Fixes #95
Fixes #94
PR Checklist:
Assisted-by: Claude Fable 5 (Claude Code)