From 21ffdef01d6b24496e020b15362a5f2460e6a6b6 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Thu, 12 Sep 2024 12:34:27 -0700 Subject: [PATCH] add backport gha --- .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 }}