feat(ci): add gitleaks to pre-commit hook

This commit is contained in:
Tuan-Dat Tran
2026-02-20 17:27:40 +01:00
parent 963b8eccf8
commit c18410bf5e

View File

@@ -1 +1,13 @@
npm run lint 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