Created
June 19, 2024 15:40
-
-
Save ingadi/848ab93b05b3da328a21f7e1e66f1c33 to your computer and use it in GitHub Desktop.
pre-push hook to check for secrets before push
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to run Gitleaks | |
run_gitleaks() { | |
if ! gitleaks detect --source . --verbose; then | |
echo "Gitleaks detected secrets in your code. Push aborted." | |
exit 1 | |
fi | |
} | |
# Allow the push if no issues are found | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment