From 353a4b204216d5d553f93aad770712f986fdf75d Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Wed, 10 Feb 2021 16:31:56 -0500 Subject: [PATCH 1/5] [CI] Fix auto-backport condditions so that it doesn't trigger for other labels --- .github/workflows/backport.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f64b9e95fbaab..818abacdf9587 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,5 +1,5 @@ on: - pull_request_target: + pull_request: branches: - master types: @@ -9,9 +9,14 @@ on: jobs: backport: name: Backport PR - if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'auto-backport') + if: | + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'auto-backport') + && ( + (github.event.action == 'labeled' && github.event.label.name == 'auto-backport') + || (github.event.action == 'closed') + ) runs-on: ubuntu-latest - steps: - name: 'Get backport config' run: | From 214abe27453667ed710c232b3d26909aaa276e86 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Wed, 10 Feb 2021 16:32:36 -0500 Subject: [PATCH 2/5] Use test branch temporarily --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 818abacdf9587..fe9da670c070a 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,7 +1,7 @@ on: pull_request: branches: - - master + - fix-autobackport-conditions types: - labeled - closed From acfbea794654ba910120264408796212dc8d1eee Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Wed, 10 Feb 2021 16:33:15 -0500 Subject: [PATCH 3/5] Fix target --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index fe9da670c070a..d5a291b4cc371 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,5 +1,5 @@ on: - pull_request: + pull_request_target: branches: - fix-autobackport-conditions types: From 38a9aa21c5e7160c1549e7da1c67a1fdd96b86e6 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Wed, 10 Feb 2021 16:33:53 -0500 Subject: [PATCH 4/5] Test conditional --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index d5a291b4cc371..bc94d76f4b6bd 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -10,7 +10,7 @@ jobs: backport: name: Backport PR if: | - github.event.pull_request.merged == true + github.event.pull_request.merged == false && contains(github.event.pull_request.labels.*.name, 'auto-backport') && ( (github.event.action == 'labeled' && github.event.label.name == 'auto-backport') From 03f4ba8d509ed046ed18ea5540d7ef94b661f4ff Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Wed, 10 Feb 2021 16:37:30 -0500 Subject: [PATCH 5/5] Remove test code --- .github/workflows/backport.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index bc94d76f4b6bd..238a21161b129 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,7 +1,7 @@ on: pull_request_target: branches: - - fix-autobackport-conditions + - master types: - labeled - closed @@ -10,7 +10,7 @@ jobs: backport: name: Backport PR if: | - github.event.pull_request.merged == false + github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'auto-backport') && ( (github.event.action == 'labeled' && github.event.label.name == 'auto-backport')