how to skip pre-commit commands on merge commits? #567
Unanswered
technicalpickles
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I swear I looked before, but was pointed to these options: pre-commit:
commands:
lint:
skip:
- merge
- rebase
run: yarn lint It seems you can skip on specific refs, but not merges from specific refs: pre-commit:
skip:
- ref: main
commands:
lint:
run: yarn lint
text:
run: yarn test |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, we use things like rubocop and other ruby commands for pre-commit hook. One problem we often run into when merging main into a branch is:
Gemfile.lock
mean that the pre-commit can't run unless you've bundledIs there any way to not run a command when it's a merge-commit? Bonus points for being able to skip specific branches (ie main).
It does not seem like the pre-commit hook doesn't have any arguments (based on git help githooks), but maybe there is another way to check?
Beta Was this translation helpful? Give feedback.
All reactions