#!/usr/bin/env bash
# commit-msg hook — validates closing keywords reference a PR number.
#
# Install:
#   cp ops/hooks/commit-msg .git/hooks/commit-msg
#   chmod +x .git/hooks/commit-msg
#
# This is a local-only hook (not enforced in CI).  It calls the Python
# validate_close_request script from ops/scripts/.  Issue #2498.

set -euo pipefail

COMMIT_MSG_FILE="$1"
SCRIPT="ops/scripts/validate_close_request.py"

if [ -f "$SCRIPT" ]; then
    python3 "$SCRIPT" "$COMMIT_MSG_FILE" || true
fi
