🔧 fix(workflows): replace greq with awk

This commit is contained in:
Eshan Roy (Eshanized)
2024-06-16 01:49:24 +05:30
parent 26153f0f8a
commit 9a88e15fb9

View File

@@ -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