File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+
8+ jobs :
9+ hooks :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - name : ShellCheck hooks
15+ run : shellcheck --severity=warning .claude/hooks/*.sh
16+
17+ # The smoke tests run with Ubuntu's default awk (mawk) — this is the
18+ # environment where the original gawk-dependent gate failed open.
19+ - name : gate-check smoke test
20+ env :
21+ CLAUDE_PROJECT_DIR : ${{ github.workspace }}
22+ run : |
23+ set -euo pipefail
24+
25+ # Protected path (migrations/ in project.yml) → must ask
26+ out=$(printf '{"tool_input":{"file_path":"%s/migrations/001.sql"}}' "$PWD" | bash .claude/hooks/gate-check.sh)
27+ echo "$out" | grep -q '"permissionDecision": "ask"'
28+
29+ # Nested path under a protected area → must ask
30+ out=$(printf '{"tool_input":{"file_path":"%s/migrations/2026/add.sql"}}' "$PWD" | bash .claude/hooks/gate-check.sh)
31+ echo "$out" | grep -q '"permissionDecision": "ask"'
32+
33+ # Unprotected path → no decision, exit 0
34+ out=$(printf '{"tool_input":{"file_path":"%s/src/index.ts"}}' "$PWD" | bash .claude/hooks/gate-check.sh)
35+ test -z "$out"
36+
37+ # Invalid JSON → no decision, exit 0
38+ out=$(printf 'not-json' | bash .claude/hooks/gate-check.sh)
39+ test -z "$out"
40+
41+ - name : session-context smoke test
42+ env :
43+ CLAUDE_PROJECT_DIR : ${{ github.workspace }}
44+ run : |
45+ set -euo pipefail
46+ # Idle template state → no injection, exit 0
47+ out=$(bash .claude/hooks/session-context.sh)
48+ test -z "$out"
You can’t perform that action at this time.
0 commit comments