From ea6ab95eba0ffdbd5f390e8ad55f20511e57eeeb Mon Sep 17 00:00:00 2001 From: probonopd Date: Sat, 15 Jul 2023 13:43:09 +0200 Subject: [PATCH] Try to properly auto-cancel builds triggered by branch updates --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a29bc70..77c39408 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,11 +33,11 @@ jobs: run: | COMMIT_MSG="$(git show -s --format=%s)" echo "$COMMIT_MSG" - if [[ $COMMIT_MSG == 'Merge branch'* ]]; then - echo "The workflow will not run as the commit message starts with 'Merge branch'." - exit 0 + if [[ $variable =~ ^Merge[[:space:]][[:xdigit:]]{40}[[:space:]]into[[:space:]][[:xdigit:]]{40}$ ]]; then + echo "The workflow will not run as it was triggered by 'Update branch'." + exit 78 # Skipped else - echo "The workflow will continue as the commit message does not start with 'Merge branch'." + echo "The workflow will continue." fi - name: Install dependencies shell: bash