Skip to content

feat(pre-commit): replace detect-secrets with gitleaks - #5

Merged
teeuwski merged 1 commit into
mainfrom
chore/gitleaks-pre-commit
Oct 13, 2026
Merged

teeuwski merged 1 commit into
mainfrom
chore/gitleaks-pre-commit

Conversation

@mariushelf

Copy link
Copy Markdown
Collaborator

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

  • Generated projects: template/.pre-commit-config.yaml.jinja now runs gitleaks instead of detect-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-wide secret-scan check runs in CI, pinned to its commit SHA. The hook is local only and does not replace that check.
  • This repository: a new root .pre-commit-config.yaml with only gitleaks, and a short Development section in the README that says to run uvx pre-commit install once.

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_commit passes. It renders a project and runs pre-commit run --all-files in it, so gitleaks runs on the generated project.
  • pre-commit run gitleaks --all-files passes on this repository.
  • A gitleaks scan of the full history finds nothing.

🤖 Generated with Claude Code

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>
@teeuwski
teeuwski merged commit fd63dc0 into main Oct 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants