2
0

commit-msg 483 B

1234567891011121314
  1. #!/usr/bin/env bash
  2. # Validate commit log
  3. commit_regex='^Merge.+|(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|types)(\(.+\))?: .{1,50}'
  4. if ! grep -iqE "$commit_regex" "$1"; then
  5. echo
  6. echo " Error: proper commit message format is required for automated changelog generation."
  7. echo
  8. echo " - Use \`npm run commit\` to interactively generate a commit message."
  9. echo " - See .github/COMMIT_CONVENTION.md for more details."
  10. echo
  11. exit 1
  12. fi