Skip to content

chore(devtools): check the branch name and PR size before push - #45

Merged
davidmoralesz merged 1 commit into
mainfrom
chore/pre-push-hooks
Oct 6, 2026
Merged

davidmoralesz merged 1 commit into
mainfrom
chore/pre-push-hooks

Conversation

@davidmoralesz

Copy link
Copy Markdown
Contributor

Adds a pre-push block to lefthook.yml that runs .devtools/check-branch-name.sh and .devtools/check-pr-size.sh: the same two scripts ci-pr runs and .pre-commit-hooks.yaml offers to consumers.

Why

This repo's own hooks only covered commit-msg and pre-commit, so a bad branch name was first reported by CI, after the pull request was open. That is how #42 was opened from docs/profile-readme and had to be replaced by #44.

Tested

  • lefthook install now syncs pre-push alongside the other two hooks.
  • lefthook run pre-push on a throwaway docs/should-fail branch: branch-name fails with the Conventional Branch message.
  • lefthook run pre-push on this branch: both commands pass.
  • The push of this branch went through the installed hook.
  • bash .devtools/test-hooks.sh: all passed.

Existing clones pick the hook up on their next pnpm install.

Known limit

Both scripts check the branch that is checked out, not the ref being pushed, so git push origin <other-branch> is checked against the wrong name. CI still catches that case.

@davidmoralesz
davidmoralesz merged commit 7367a2c into main Oct 6, 2026
5 checks passed
@davidmoralesz
davidmoralesz deleted the chore/pre-push-hooks branch October 6, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant