From 3b5ee45336f3d14f394520cec4abb1c15ce6899d Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Wed, 23 Oct 2024 19:05:35 -0700 Subject: [PATCH] add backport gha (#4372) --- .github/workflows/backport.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 000000000000..67ce5d23f4fb --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,26 @@ +name: Backport +on: + pull_request_target: + types: + - closed + - labeled + +jobs: + backport: + name: Backport + runs-on: ubuntu-latest + # 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: + - uses: sourcegraph/backport@v2 + with: + github_token: ${{ secrets.BACKPORT_GITHUB_TOKEN }}