Add a local pre-commit gitleaks hook so secrets are caught before they leave your
machine, not just at CI time. Mirrors the secret-scanning CI job — same .gitleaks.toml allowlist, same tool.
To activate (one-time, per clone)
bash scripts/git-hooks/install.sh
This copies scripts/git-hooks/pre-commit to .git/hooks/pre-commit. If gitleaks
isn't installed locally the hook no-ops with a warning (CI still catches it either way).
Test plan
Merge, then run the installer once locally
Confirm git commit with a fake secret in a staged file is blocked
## Summary
Add a local **pre-commit** gitleaks hook so secrets are caught before they leave your
machine, not just at CI time. Mirrors the `secret-scanning` CI job — same
`.gitleaks.toml` allowlist, same tool.
## To activate (one-time, per clone)
```bash
bash scripts/git-hooks/install.sh
```
This copies `scripts/git-hooks/pre-commit` to `.git/hooks/pre-commit`. If `gitleaks`
isn't installed locally the hook no-ops with a warning (CI still catches it either way).
## Test plan
- [ ] Merge, then run the installer once locally
- [ ] Confirm `git commit` with a fake secret in a staged file is blocked
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add a local pre-commit gitleaks hook so secrets are caught before they leave your
machine, not just at CI time. Mirrors the
secret-scanningCI job — same.gitleaks.tomlallowlist, same tool.To activate (one-time, per clone)
This copies
scripts/git-hooks/pre-committo.git/hooks/pre-commit. Ifgitleaksisn't installed locally the hook no-ops with a warning (CI still catches it either way).
Test plan
git commitwith a fake secret in a staged file is blocked