Add fork-PR-target hook (verbatim from bang-game #63) + battery CI gate

Propagates the PreToolUse enforce-pr-target.sh backstop (byte-identical to
claridtimo/bang-game master) that denies any `gh pr create` not explicitly
aimed at claridtimo/*, guarding against accidental PRs on the greyhavens
upstream fork parent. Ships the 103-case regression battery and a CI job
(.github/workflows/hook-battery.yml) that gates it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E3cmNbMM8gGpprBy8kcNuV
This commit is contained in:
2026-07-10 16:33:16 +12:00
parent f2bde4c460
commit d4970fe4b2
4 changed files with 615 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
name: Hook battery
on:
push:
branches: [master, main]
pull_request:
jobs:
hook-battery:
name: PR-target hook battery
# The PreToolUse hook (.claude/hooks/enforce-pr-target.sh) is the enforced backstop against
# accidentally opening PRs on the upstream fork parent (fork of greyhavens/*). Verbatim copy
# of the bang-game hook (see claridtimo/bang-game#63 for the 21-round review history); the
# battery pins every bypass / false-deny class found there. Seconds-fast: bash+python3+grep.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run the enforce-pr-target regression battery
run: .claude/hooks/test-enforce-pr-target.sh