From f326f14da72b642bd7e47981ea642210bba5df66 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 24 Mar 2024 06:56:21 +0100 Subject: [PATCH] [CI] backport: do no nothing if there are no backport labels --- .forgejo/workflows/backport.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/backport.yml b/.forgejo/workflows/backport.yml index 59d953ebeb..de6e987ab2 100644 --- a/.forgejo/workflows/backport.yml +++ b/.forgejo/workflows/backport.yml @@ -34,10 +34,14 @@ jobs: !startsWith(vars.ROLE, 'forgejo-') && ( github.event.pull_request.merged && ( - github.event.action == 'closed' - || ( - github.event.action == 'labeled' - && contains(github.event.label.name, 'backport/') + ( + github.event.action == 'closed' && + contains(toJSON(github.event.pull_request.labels), 'backport/v') + ) + || + ( + github.event.action == 'labeled' && + contains(github.event.label.name, 'backport/v') ) ) ) @@ -54,7 +58,7 @@ jobs: export DEBIAN_FRONTEND=noninteractive apt-get update -qq apt-get -q install -qq -y jq - filtered_labels=$(echo "$LABELS" | jq -c 'map(select(.name | startswith("backport/")))') + filtered_labels=$(echo "$LABELS" | jq -c 'map(select(.name | startswith("backport/v")))') echo "FILTERED_LABELS=${filtered_labels}" >> $GITHUB_ENV env: LABELS: ${{ toJSON(github.event.pull_request.labels) }}