This repository uses Gitleaks with .gitleaks.toml as the single rule source.
flowchart LR
Change[config/code/docs change] --> Staged[pnpm secrets:scan:staged]
Staged --> Commit{clean?}
Commit -- yes --> Push[push/PR]
Commit -- no --> Remove[remove secret and rotate if exposed]
Push --> Full[pnpm secrets:scan in pnpm verify]
Install local hooks after cloning:
pnpm hooks:installThe project uses Husky for local git hooks. The prepare script also runs Husky after dependency installation.
Run a full repository scan:
pnpm secrets:scanRun the staged pre-commit scan manually:
pnpm secrets:scan:stagedThe hooks fail closed. If gitleaks is not installed, git commit and git push fail with an installation prompt instead of silently skipping the scan.
flowchart TD
Finding[Gitleaks finding] --> Real{real secret?}
Real -- yes --> Remove[remove from change]
Remove --> Rotate[rotate credential if committed or shared]
Real -- no --> Placeholder[prefer placeholder or narrow rule]
Placeholder --> Targeted[only targeted allowlist if needed]
If Gitleaks reports a real secret, remove it from the change and rotate the credential if it was ever committed or shared.
If Gitleaks reports a false positive, prefer one of these fixes:
- Replace the value with an obvious placeholder such as
example,changeme, or${ENV_VAR}. - Narrow the rule in
.gitleaks.toml. - Add a targeted allowlist entry with a clear description.
Do not add broad allowlists for whole source directories.
For emergency local work only, hooks can be skipped explicitly:
SKIP_GITLEAKS=1 git commit -m "message"
SKIP_GITLEAKS=1 git pushThis is a risk operation. Run pnpm secrets:scan before sharing the branch.