Question: how to work with husky precommit
See original GitHub issueI’m having a problem running, it was working well until I added a pre-commit task to run some linter validations and flow typechecker. I have this configuration in my package.json
"husky": {
"hooks": {
"pre-commit": "lint-staged && yarn flow"
}
},
running yarn semantic-release
it start running well until it try to commit and push the package.json
with the new generated version. at that moment I can see how the pre-commit
task start but when it finishes without errors, the semantic-releases
never resume.
I tried changing this: await execa('git', ['commit', '-m', message], execaOpts);
to this: await execa('git', ['commit', '-m', message, '--no-verify'], execaOpts);
and it worked well because I’m preventing to run husky
.
So, my questions is, how can I send the --no-verify
flag when I run semantic-release? or how can I tell semantic-release to resume when the linters and flow finished without error?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
On the same subject, husky v6 has removed
HUSKY_SKIP_HOOKS=1
butHUSKY=0
can be used insteadFor what is worth, the answer provided by @jfairley absolutely does solve this issue; however, using
HUSKY_SKIP_HOOKS=1
(instead ofCI=true
) seems like a more appropriate solution.https://github.com/typicode/husky/blob/master/README.md#skip-all-hooks-rebase