From 9a88e15fb9676f78b493b83c888cca2177cb86bf Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" <148610067+eshanized@users.noreply.github.com> Date: Sun, 16 Jun 2024 01:49:24 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(workflows):=20replace=20greq?= =?UTF-8?q?=20with=20awk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/commit.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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