Skip to content

Instantly share code, notes, and snippets.

@ingadi
Created June 19, 2024 15:40
Show Gist options
  • Save ingadi/848ab93b05b3da328a21f7e1e66f1c33 to your computer and use it in GitHub Desktop.
Save ingadi/848ab93b05b3da328a21f7e1e66f1c33 to your computer and use it in GitHub Desktop.
pre-push hook to check for secrets before push
# 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