Layer secret leak guardrails
Some checks failed
secret-guardrails / artifact-secret-scan (push) Has been cancelled
secret-guardrails / gitleaks (push) Has been cancelled

This commit is contained in:
Hermes Agent
2026-05-22 21:23:15 +00:00
parent 0b528cbb5f
commit d62a391cbf
5 changed files with 195 additions and 47 deletions

18
.githooks/pre-push Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root="$(git rev-parse --show-toplevel)"
scanner="$repo_root/scripts/scan-secret-bearing-artifacts.sh"
while read -r local_ref local_sha remote_ref remote_sha; do
[[ -n "$local_sha" ]] || continue
if [[ "$local_sha" =~ ^0+$ ]]; then
continue
fi
if [[ "$remote_sha" =~ ^0+$ ]]; then
"$scanner" --unpublished "$local_sha"
else
"$scanner" --git-range "$remote_sha..$local_sha"
fi
done