Compare commits
1 commit
c60d0eeb83
...
ba9b69350e
Author | SHA1 | Date | |
---|---|---|---|
|
ba9b69350e |
|
@ -22,7 +22,7 @@ jobs:
|
|||
run: |
|
||||
echo "Checking if the subject starts correctly..."
|
||||
commit_message=$(git log -1 --pretty=%B)
|
||||
if ! [[ "$commit_message" =~ ^([A-Z]|\S+:|git\ subrepo\ (clone|pull)) ]]; then
|
||||
if ! echo "$commit_message" | grep -Eq "^([A-Z]|\S+:|git subrepo (clone|pull))"; then
|
||||
echo "Error: The subject does not start with a capital letter, a tag, or a valid 'git subrepo' command."
|
||||
exit 1
|
||||
fi
|
||||
|
@ -32,7 +32,7 @@ jobs:
|
|||
run: |
|
||||
echo "Checking commit message type and format..."
|
||||
commit_message=$(git log -1 --pretty=%B)
|
||||
if ! [[ "$commit_message" =~ ^(feat|fix|chore|docs|style|refactor|test|perf): ]]; then
|
||||
if ! echo "$commit_message" | grep -Eq "^(feat|fix|chore|docs|style|refactor|test|perf):"; then
|
||||
echo "Error: Commit message does not follow the required format: <type>: <subject>"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -42,7 +42,7 @@ jobs:
|
|||
run: |
|
||||
echo "Checking subject length..."
|
||||
commit_subject=$(git log -1 --pretty=%B | head -n 1)
|
||||
if [[ ${#commit_subject} -gt 72 ]]; then
|
||||
if [ ${#commit_subject} -gt 72 ]; then
|
||||
echo "Error: Commit message subject exceeds 72 characters."
|
||||
exit 1
|
||||
fi
|
||||
|
@ -52,7 +52,7 @@ jobs:
|
|||
run: |
|
||||
echo "Checking subject ending..."
|
||||
commit_subject=$(git log -1 --pretty=%B | head -n 1)
|
||||
if [[ "$commit_subject" =~ \.$ ]]; then
|
||||
if echo "$commit_subject" | grep -q "\.$"; then
|
||||
echo "Error: Commit message subject should not end with a dot."
|
||||
exit 1
|
||||
fi
|
||||
|
@ -62,7 +62,7 @@ jobs:
|
|||
run: |
|
||||
echo "Checking for an empty line after the title..."
|
||||
commit_body=$(git log -1 --pretty=%B | tail -n +2)
|
||||
if [[ -n "$commit_body" && ! "$commit_body" =~ ^$ ]]; then
|
||||
if [ -n "$commit_body" ] && ! echo "$commit_body" | grep -q "^$"; then
|
||||
echo "Error: There must be an empty line between the title and description."
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue