Repository navigation
feat(pre-commit): replace detect-secrets with gitleaks - #5
Merged
Merged
Conversation
Generated projects now scan staged changes with gitleaks v8.30.1, the same version as the org-wide secret-scan check, instead of detect-secrets. The template repository itself gets the same hook. Co-Authored-By: Claude Opus 5.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.
Hi! 👋 This is the switch to gitleaks that Marius and Adir suggested. Every new project made from this template gets the same secret scanner as the rest of the org.
What
template/.pre-commit-config.yaml.jinjanow runs gitleaks instead ofdetect-secrets. Before each commit, the hook scans the staged changes for secrets and stops the commit if it finds one. It uses gitleaks v8.30.1, the same version that the org-widesecret-scancheck runs in CI, pinned to its commit SHA. The hook is local only and does not replace that check..pre-commit-config.yamlwith only gitleaks, and a short Development section in the README that says to runuvx pre-commit installonce.Thanks to Cas for adding secret scanning to the template in the first place. This keeps the idea and moves it to the tool the org check already uses.
Checks
pytest -k pre_commitpasses. It renders a project and runspre-commit run --all-filesin it, so gitleaks runs on the generated project.pre-commit run gitleaks --all-filespasses on this repository.🤖 Generated with Claude Code