11 lines
393 B
Bash
Executable File
11 lines
393 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Blocks accidental commits of signing secrets (defence in depth on top of .gitignore).
|
|
set -euo pipefail
|
|
blocked=$(git diff --cached --name-only --diff-filter=ACM \
|
|
| grep -Ei '(^|/)keys/|\.jks$|\.keystore$|\.p12$|(^|/)key\.properties$' || true)
|
|
if [ -n "$blocked" ]; then
|
|
echo 'REFUSED: signing secrets must never be committed:' >&2
|
|
echo "$blocked" >&2
|
|
exit 1
|
|
fi
|