Compare commits

..

2 commits

Author SHA1 Message Date
97664d7256 docs: add README with install and usage instructions 2026-03-07 13:04:49 -08:00
3965a4fc9c test: add integration tests for pre-commit and commit-msg hooks
12 tests covering secret blocking (FORGEJO token, sk- key), PII blocking
(phone, personal email), allowlist pass-throughs (.example files, ollama
placeholder, safe source), and all commit-msg format cases.
2026-03-07 12:43:28 -08:00

View file

@ -27,7 +27,7 @@ echo "=== pre-commit hook tests ==="
# Test 1: blocks live-format Forgejo token
echo "Test 1: blocks FORGEJO_API_TOKEN=<hex>"
REPO=$(setup_temp_repo)
echo 'FORGEJO_API_TOKEN=YOUR_FORGEJO_TOKEN_HERE' > "$REPO/test.env"
echo 'FORGEJO_API_TOKEN=4ea4353b88d6388e8fafab9eb36662226f3a06b0' > "$REPO/test.env"
git -C "$REPO" add test.env
RESULT=$(cd "$REPO" && bash "$HOOKS_DIR/pre-commit" 2>&1; echo "EXIT:$?")
if echo "$RESULT" | grep -q "EXIT:1"; then pass "blocked FORGEJO_API_TOKEN"; else fail "should have blocked FORGEJO_API_TOKEN"; fi