Files
playbooks/scripts/check-commit-msg.sh
T
tanshu 2aab1aec1e Add secret scanning, layout checks, and a --changed mode
gitleaks runs before each commit and in CI, with known values in a redacted baseline. The layout check rejects empty readmes and main.yml role entrypoints. --changed lints only the YAML files that differ from HEAD.
2026-10-18 21:53:29 +05:30

21 lines
453 B
Bash
Executable File

#!/usr/bin/env bash
# Reject placeholder commit subjects. pre-commit passes the message file.
set -euo pipefail
message_file="$1"
subject=$(head -n 1 "$message_file")
if [ -z "${subject//[[:space:]]/}" ]; then
echo "commit subject is empty" >&2
exit 1
fi
case "${subject,,}" in
misc|misc.|wip|wip.|update|updates|fix|fixes|change|changes|stuff|temp|tmp)
echo "commit subject is a placeholder: '$subject'" >&2
exit 1
;;
esac
exit 0