From 1cb1159c8a44eec469bef3fc9bc857c2dc57ee97 Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" <148610067+eshanized@users.noreply.github.com> Date: Sun, 16 Jun 2024 02:00:50 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(workflows):=20LATEST=5FCOMMI?= =?UTF-8?q?T=5FMESSAGE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/commit.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index a6a84c1..3d8a90f 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -28,17 +28,14 @@ jobs: for type in "${conventional_types[@]}"; do echo "Searching for pattern: ${commit_emojis[$type]} ${type}(:|:)" - if echo "$LATEST_COMMIT_MESSAGE" | awk -v emoji="${commit_emojis[$type]}" -v type="$type" ' - $0 ~ "^" emoji " " type "(:|:)" { print "Conventional commit message found: " $0; exit 0 } - '; then - : - else - : + if echo "$LATEST_COMMIT_MESSAGE" | grep -qE "^${commit_emojis[$type]} ${type}(:|:)" ; then + echo "Conventional commit message found: $LATEST_COMMIT_MESSAGE" + exit 0 fi done echo "Error: Commit message is not conventional" exit 1 - # shell: /usr/bin/bash -e - # env: - # LATEST_COMMIT_MESSAGE: 🔧 fix(workflows): debug for continued issue \ No newline at end of file + shell: /usr/bin/bash -e + env: + LATEST_COMMIT_MESSAGE: 🔧 fix(workflows): debug for continued issue \ No newline at end of file