Skip to content

chore(config): fix pre-push to guard by push destination#21

Merged
kodyhagen-gh merged 1 commit into
releasefrom
chore/pre-push-destination-guard
Jul 8, 2026
Merged

chore(config): fix pre-push to guard by push destination#21
kodyhagen-gh merged 1 commit into
releasefrom
chore/pre-push-destination-guard

Conversation

@kodyhagen-gh

Copy link
Copy Markdown
Contributor

Fixes the pre-push hook to gate on the ref being pushed instead of the checked-out branch. Previously any push made while on main or release was blocked (including branch deletions), and a direct push to a protected branch from a differently-named local branch slipped through. It now reads git's stdin ref list and refuses only pushes whose destination is main or release, allowing deletions and all other pushes. One of six repos sharing this hook.

…anch

The hook keyed off the checked-out branch, so it blocked every push made
while on main or release (including unrelated branch deletions) and let a
direct push to a protected branch through when it came from a
differently-named local branch. Read the refs git streams on stdin and
refuse only when the push destination is main or release; deletions and
every other push are allowed.
@kodyhagen-gh
kodyhagen-gh merged commit 6937282 into release Jul 8, 2026
2 checks passed
@kodyhagen-gh
kodyhagen-gh deleted the chore/pre-push-destination-guard branch July 8, 2026 17:13
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