aboutsummaryrefslogtreecommitdiff
path: root/.githooks/pre-commit
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-28 11:45:11 +0100
committercirakg <cirakg@cirakg.xyz>2026-10-28 11:45:11 +0100
commit09ef21af399a60ceb2e45526fe1a7dd94c53819c (patch)
tree7992abb501f75dfe393b2bfd424227d1fc06b5b6 /.githooks/pre-commit
parent3096eb7d366683caec24ed5d0a70ac5dae6f624d (diff)
chore: prepare repository for open-source release
Diffstat (limited to '.githooks/pre-commit')
-rwxr-xr-x.githooks/pre-commit12
1 files changed, 12 insertions, 0 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
new file mode 100755
index 0000000..d104d78
--- /dev/null
+++ b/.githooks/pre-commit
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+# Author: cirakg & claude ai
+# Summary: Scan staged changes with Gitleaks before committing.
+set -eu
+
+if ! command -v gitleaks >/dev/null 2>&1; then
+ echo "Gitleaks is required by this hook. See CONTRIBUTING.md for installation." >&2
+ exit 1
+fi
+
+repo_root=$(git rev-parse --show-toplevel)
+exec gitleaks git --pre-commit --staged --redact --no-banner --config "$repo_root/.gitleaks.toml" "$repo_root"