diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml index cfcb5354fe..04e9efd8b5 100644 --- a/.github/workflows/conventional-commits.yml +++ b/.github/workflows/conventional-commits.yml @@ -33,14 +33,14 @@ jobs: pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?!?: [^ ].*' failed=0 check() { - if [[ "$2" =~ $pattern ]]; then + if [[ "${3:-$2}" =~ $pattern ]]; then echo "ok $1: $2" else echo "::error::$1 is not a conventional commit: $2" failed=1 fi } - check "PR title" "$PR_TITLE" + check "PR title" "$PR_TITLE" "${PR_TITLE#\[*\] }" while IFS= read -r subject; do [[ "$subject" == Merge\ * ]] && continue check "Commit" "$subject"