From a345e4e0626ae3f5089ae4e478770fecd1ab912c Mon Sep 17 00:00:00 2001 From: Louis Chu Date: Sun, 21 Jan 2024 10:19:41 +0800 Subject: [PATCH] Trigger barkport workflow when a pull request merges Context: This [PR](https://github.com/opensearch-project/opensearch-spark/actions/runs/7587593648/job/20668300157?pr=209) has a backport label before merged, which failed the backport workflow. To fix this, we need to trigger barkport workflow when a pull request merges Ref https://github.com/opensearch-project/OpenSearch/blob/main/.github/workflows/backport.yml#L12-L22 Signed-off-by: Louis Chu --- .github/workflows/backport.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index fdea67753..e641ad267 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -12,6 +12,17 @@ jobs: contents: write pull-requests: write name: Backport + # Only react to merged PRs for security reasons. + # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) steps: - name: GitHub App token id: github_app_token