chore: block secrets in commits with a Betterleaks hook

The ignore file covers one old Gitea token in deleted .env.local, which
was confirmed revoked (API returned 401).
This commit is contained in:
kasun committed 2026-11-23 00:12:55 +01:00
1 parent 12400b4c83
commit 0d5f49591a
3 files changed
+16 -1

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Git pre-commit hook: blocks a commit if its staged changes contain a secret.
#
# Activate once per clone: git config core.hooksPath .githooks
# Skip in an emergency: git commit --no-verify
if ! command -v betterleaks >/dev/null 2>&1; then
echo "pre-commit: betterleaks is not installed, so staged changes can't be scanned" >&2
exit 1
fi
exec betterleaks git --pre-commit --staged --redact --no-banner --no-color .