Skip to content

chore(githooks): add pre-push guard for protected branches#137

Merged
jfrench9 merged 2 commits into
mainfrom
chore/pre-push-guard
Jul 14, 2026
Merged

chore(githooks): add pre-push guard for protected branches#137
jfrench9 merged 2 commits into
mainfrom
chore/pre-push-guard

Conversation

@jfrench9

Copy link
Copy Markdown
Member

Summary

  • Add .githooks/pre-push blocking direct pushes to main / master / release/* (feature branches pass through)
  • Install hooks via new install-hooks justfile recipe, wired into venv so fresh clones get them on setup
  • Allow Bash(git push:*) in .claude/settings.json (feature-branch pushes; the hook + branch protection guard main)

Test plan

  • printf 'l s refs/heads/main s\n' | .githooks/pre-push exits 1 (blocked); a feature ref exits 0
  • just install-hooks sets core.hooksPath=.githooks
  • pre-commit suite (ruff, format, basedpyright, 439 tests) passes

jfrench9 added 2 commits July 14, 2026 00:35
Add a pre-push hook that rejects direct pushes whose destination ref is
main, master, or release/*, so those land only through pull requests.
Feature branches pass through. Picked up via the existing
core.hooksPath=.githooks wiring. Also move git push from deny to allow in
the Claude Code settings, with the hook as the branch-level guard.
@jfrench9 jfrench9 merged commit 5c2115b into main Jul 14, 2026
1 check passed
@jfrench9 jfrench9 deleted the chore/pre-push-guard branch July 14, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant