diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 11ec2ca6b..6999ce302 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,8 +25,8 @@ jobs: steps: - name: Lint PR Title run: | - REGEX="^(fix|feat|refactor|revert|test|perf|style|chore|docs): [a-z][^.]{0,60}( \\(\\#\\d+\\))?$" - if echo "${PR_TITLE}" | grep -Eq "${REGEX}"; then + REGEX="^(fix|feat|refactor|revert|test|perf|style|chore|docs): [a-z][^.\n]{0,60}$" + if [[ "${PR_TITLE}" =~ ${REGEX} ]]; then echo -e "PR title is valid: ${PR_TITLE}" else echo -e "Invalid PR title: ${PR_TITLE}"