diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 2fdd242..d9c738b 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -25,9 +25,13 @@ jobs: commit_emojis=("build"="๐Ÿ—๏ธ" "chore"="๐Ÿงน" "ci"="๐Ÿค–" "docs"="๐Ÿ“š" "feat"="๐ŸŽ‰" "fix"="๐Ÿ”ง" "perf"="โšก๏ธ" "refactor"="๐Ÿ’ก" "revert"="๐Ÿšจ" "style"="๐Ÿ’„" "test"="๐Ÿงช") for type in "${conventional_types[@]}"; do - if echo "$LATEST_COMMIT_MESSAGE" | grep -qE "^${commit_emojis[$type]} ${type}(:|:)"; then - echo "Conventional commit message found: $LATEST_COMMIT_MESSAGE" - exit 0 + if echo "$LATEST_COMMIT_MESSAGE" | awk -v emoji="${commit_emojis[$type]}" -v type="$type" ' + BEGIN { pattern = "^" emoji " " type "(:|:)" } + /pattern/ { print "Conventional commit message found: " $0; exit 0 } + '; then + : + else + : fi done