From c18410bf5ebe3048db3ddadcbbc0afa55147f241 Mon Sep 17 00:00:00 2001 From: Tuan-Dat Tran Date: Fri, 20 Feb 2026 17:27:40 +0100 Subject: [PATCH] feat(ci): add gitleaks to pre-commit hook --- .husky/pre-commit | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index 3867a0f..f1a354d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,13 @@ npm run lint + +# Gitleaks secret scanning +if command -v gitleaks &> /dev/null; then + gitleaks protect --verbose --staged + if [ $? -eq 1 ]; then + echo "" + echo "❌ Secrets detected in staged files!" + echo "Please remove sensitive data before committing." + echo "" + exit 1 + fi +fi