From 354452992fae6a8e7c062e2fe5943767e5d40579 Mon Sep 17 00:00:00 2001 From: Anil Vishnoi Date: Wed, 2 Oct 2024 15:24:26 -0700 Subject: [PATCH 1/2] Test PR to debug the cherry-pick workflow Signed-off-by: Anil Vishnoi --- .github/workflows/cherry-pick.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cherry-pick.yml b/.github/workflows/cherry-pick.yml index 126a25d7..5cf6d9cf 100644 --- a/.github/workflows/cherry-pick.yml +++ b/.github/workflows/cherry-pick.yml @@ -1,4 +1,4 @@ -name: Cherry pick PR into release-1.0 branch +name: Cherry pick PR to release-1.0 branch on: pull_request_target: @@ -8,7 +8,7 @@ on: jobs: cherry_pick_release_1_0: runs-on: ubuntu-latest - name: Cherry pick into release-1.0 branch + name: Cherry pick PR to release-1.0 branch if: ${{ contains(github.event.pull_request.labels.*.name, 'cherry-pick-release-1.0') && github.event.pull_request.merged == true }} steps: - name: Checkout From 01f3da76633a9c058ccaec084c5cffe6d3de94b7 Mon Sep 17 00:00:00 2001 From: Anil Vishnoi Date: Wed, 2 Oct 2024 15:26:43 -0700 Subject: [PATCH 2/2] Set workflow to trigger on closed/merged PR Signed-off-by: Anil Vishnoi --- .github/workflows/cherry-pick.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cherry-pick.yml b/.github/workflows/cherry-pick.yml index 5cf6d9cf..2628f0fc 100644 --- a/.github/workflows/cherry-pick.yml +++ b/.github/workflows/cherry-pick.yml @@ -1,15 +1,20 @@ name: Cherry pick PR to release-1.0 branch on: - pull_request_target: + pull_request: branches: - main + types: ["closed", "labeled"] + +permissions: + contents: write + pull-requests: write jobs: cherry_pick_release_1_0: runs-on: ubuntu-latest name: Cherry pick PR to release-1.0 branch - if: ${{ contains(github.event.pull_request.labels.*.name, 'cherry-pick-release-1.0') && github.event.pull_request.merged == true }} + if: ${{ contains(github.event.pull_request.labels.*.name, 'cherry-pick-release-1.0') }} steps: - name: Checkout uses: actions/checkout@v4