Skip to content

Commit

Permalink
chore: skip cz if commit message is auto-generated
Browse files Browse the repository at this point in the history
When releasing a new version, 'git commit -m "<version>"' is automatically executed. But since there
is an hook to run cz when the 'git commit' command is used, cz was also being used when the commit
message was are-defined. A check was necessary to prevent that from happening.
  • Loading branch information
cedoor committed Mar 13, 2024
1 parent 7ee69bc commit 6ccffab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty && yarn cz --hook || true
if [ "$NO_HOOK" != "1" ]; then
exec < /dev/tty && yarn cz --hook || true
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test:library": "jest packages/${0}",
"test:circuits": "yarn workspace @zk-kit/circuits test",
"test:contracts": "yarn workspace imt.sol test:coverage",
"version:bump": "yarn workspace @zk-kit/${0} version ${1} && git commit -am \"chore(${0}): v${1}\" && git tag ${0}-v${1}",
"version:bump": "yarn workspace @zk-kit/${0} version ${1} && NO_HOOK=1 git commit -m \"chore(${0}): v${1}\" && git tag ${0}-v${1}",
"version:publish": "yarn workspaces foreach -A --no-private npm publish --tolerate-republish --access public",
"version:release": "changelogithub",
"lint": "eslint . --ext .js,.ts && yarn workspace imt.sol lint",
Expand Down

0 comments on commit 6ccffab

Please sign in to comment.