diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index d9c738b..f01ed73 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -24,7 +24,13 @@ jobs: conventional_types=("build" "chore" "ci" "docs" "feat" "fix" "perf" "refactor" "revert" "style" "test") commit_emojis=("build"="๐Ÿ—๏ธ" "chore"="๐Ÿงน" "ci"="๐Ÿค–" "docs"="๐Ÿ“š" "feat"="๐ŸŽ‰" "fix"="๐Ÿ”ง" "perf"="โšก๏ธ" "refactor"="๐Ÿ’ก" "revert"="๐Ÿšจ" "style"="๐Ÿ’„" "test"="๐Ÿงช") + echo "LATEST_COMMIT_MESSAGE: $LATEST_COMMIT_MESSAGE" + for type in "${conventional_types[@]}"; do + pattern="^${commit_emojis[$type]} ${type}(:|:)" + + echo "Searching for pattern: $pattern" + 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 }