2022-09-17 15:19:12 +08:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
commit_msg=$(cat "$1")
|
|
|
|
|
|
|
|
|
|
email=$(git config user.email)
|
2022-12-22 15:08:36 +08:00
|
|
|
|
msg_re="^(\[Feature\]|\[Fix\]|\[Docs\]|\[Refactor\]|\[Test\]|\[Workflow\]|\[Build\]|\[Ci\]|\[Env\]|\[Release\]|\[Api\]|\[Web\]|\[Core\]|\[Spi\]|\[Plugin\]|\[Client\])(\(.+\))? .{1,100}"
|
2022-09-17 15:19:12 +08:00
|
|
|
|
|
|
|
|
|
if [[ ! $commit_msg =~ $msg_re ]]; then
|
|
|
|
|
printf "Invalid commit message submission format. Please use the correct format:\
|
2022-11-15 15:20:23 +08:00
|
|
|
|
\n [Feature]|[Fix]|[Docs]|[Refactor]|[Test]|[Workflow]|[Build]|[Ci]|[Env]|[Release]|[Api]|[Web]|[Core]|[Spi]|[Plugin] \
|
|
|
|
|
\n [Feature]: Add comments \
|
|
|
|
|
\n [Fix]: Handle events on blur (close #28) %s"
|
2022-09-17 15:19:12 +08:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|