Repository navigation
ci: harden workflows and add gitleaks secret scan - #31
Merged
Merged
Conversation
- Default GITHUB_TOKEN to contents: read in both workflows; grant id-token: write only to the PyPI publish job and contents: write only to the GitHub release job. - Pin every action to a full commit SHA: checkout v7.0.1, setup-python v7.0.0, gh-action-pypi-publish v1.14.2 (was a moving release/v1 branch). - Set persist-credentials: false on every checkout. - Pass the release tag through env instead of template expansion. - Add a Secrets / gitleaks job: pinned v8.30.1 binary verified against a checksum in the workflow, redacted output, PR commits only on pull requests and full history on pushes. - Document an optional gitleaks pre-commit hook in CONTRIBUTING.md.
This was referenced Oct 1, 2026
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.
Phase 0 security hardening for the GitHub Actions workflows.
Changes
GITHUB_TOKEN(test.yml)contents: readGITHUB_TOKEN(publish.yml)contents: write+id-token: writefor every job, including the reused test jobcontents: readby default;id-token: writeonly inpublish,contents: writeonly ingithub-releasecheckout@v4/v6,setup-python@v5/v6,pypi-publish@release/v1)checkoutv7.0.1,setup-pythonv7.0.0,pypi-publishv1.14.2.git/configpersist-credentials: falseeverywhere${{ github.ref_name }}expanded into the shellenv: TAG--redact, PR commits only on pull requests, full history on pushesCONTRIBUTING.mdSupersedes Dependabot #26 and #28 (same actions bumped to v7 by tag; this pins by SHA, and Dependabot keeps SHA pins and their comments current).
Verification
actionlint: clean.zizmor: 0 high/medium/low (one help-level style hint about the self-repositoryuses:syntax).git ls-remote; the annotatedpypi-publishtag is dereferenced to its commit.REDACTED; a clean range exits 0.id-token: writeon the job that publishes). Full proof comes with the next tag.