🔧 fix(workflows): Changed the pattern to pattern="${commit_emojis[$type]} ${type}" to correctly construct the pattern

This commit is contained in:
Eshan Roy (Eshanized)
2024-06-16 02:08:20 +05:30
parent b3e20d7085
commit 0e0812f734

View File

@@ -27,8 +27,9 @@ jobs:
echo "LATEST_COMMIT_MESSAGE: $LATEST_COMMIT_MESSAGE"
for type in "${conventional_types[@]}"; do
echo "Searching for pattern: ${commit_emojis[$type]} ${type}(:|:)"
if echo "$LATEST_COMMIT_MESSAGE" | grep -qE "^${commit_emojis[$type]} ${type}(:|:)"; then
pattern="${commit_emojis[$type]} ${type}"
echo "Searching for pattern: $pattern(:|:)?"
if echo "$LATEST_COMMIT_MESSAGE" | grep -qE "^$pattern(:|:)?" ; then
echo "Conventional commit message found: $LATEST_COMMIT_MESSAGE"
exit 0
fi