examples and more tests

This commit is contained in:
zach rice committed 2019-11-12 20:08:17 -05:00
1 parent c8f9560aa3
commit 275232f8c8
8 files changed
+102 -1

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# This is an example of what adding gitleaks to a pre-commit hook would look like.
gitleaksEnabled=$(git config --bool hooks.gitleaks)
cmd="/Users/zrice/go/src/github.com/zricethezav/gitleaks/gitleaks --verbose --redact --pretty"
if [ $gitleaksEnabled == "true" ]; then
$cmd
if [ $? -eq 1 ]; then
cat <<\EOF
Error: gitleaks has detected sensitive information in your changes.
If you know what you are doing you can disable this check using:
git config hooks.gitleaks false
EOF
exit 1
fi
fi