From 58a4855a48e454554df2388ce4e2eb6cbd661b42 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Thu, 26 Sep 2024 11:49:35 -0500 Subject: [PATCH] Reapply "[workflows] Add condition to if backport:skip event (#194158)" This reverts commit 1992a394438da98f4295c3dc07cd30af9aa74746. --- .github/workflows/on-merge.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/on-merge.yml b/.github/workflows/on-merge.yml index 14f94571d551f..c7f66839ed4dc 100644 --- a/.github/workflows/on-merge.yml +++ b/.github/workflows/on-merge.yml @@ -10,21 +10,23 @@ jobs: name: 'Label and Backport' runs-on: ubuntu-latest if: | - github.event.pull_request.merged == true - && ( - ( - github.event.action == 'labeled' && ( - github.event.label.name == 'backport:prev-minor' - || github.event.label.name == 'backport:prev-major' - || github.event.label.name == 'backport:current-major' - || github.event.label.name == 'backport:all-open' - || github.event.label.name == 'backport:version' - || github.event.label.name == 'auto-backport' - ) - ) - || (github.event.action == 'unlabeled' && github.event.label.name == 'backport:skip') - || (github.event.action == 'closed') - ) + github.event.pull_request.merged == true && + (github.event.action == 'closed' || + (github.event.action == 'labeled' && + (github.event.label.name == 'backport:prev-minor' || + github.event.label.name == 'backport:prev-major' || + github.event.label.name == 'backport:current-major' || + github.event.label.name == 'backport:all-open' || + github.event.label.name == 'backport:version' || + github.event.label.name == 'auto-backport')) || + (github.event.action == 'unlabeled' && + github.event.label.name == 'backport:skip' && + (contains(github.event.pull_request.labels.*.name, 'backport:prev-minor') || + contains(github.event.pull_request.labels.*.name, 'backport:prev-major') || + contains(github.event.pull_request.labels.*.name, 'backport:current-major') || + contains(github.event.pull_request.labels.*.name, 'backport:all-open') || + contains(github.event.pull_request.labels.*.name, 'backport:version') || + contains(github.event.pull_request.labels.*.name, 'auto-backport')))); steps: - name: Checkout Actions uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7