From 010d30152579830dbaed9f0c046c1998b01c3f4c Mon Sep 17 00:00:00 2001 From: Mark Cohen Date: Tue, 1 Nov 2022 09:17:23 -0400 Subject: [PATCH] updating backport to 2.0 Signed-off-by: Mark Cohen --- .github/workflows/backport.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index e47d8d8..02ea595 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -7,22 +7,20 @@ on: jobs: backport: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write 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: - - name: GitHub App token - id: github_app_token - uses: tibdex/github-app-token@v1.5.0 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - installation_id: 22958780 - - - name: Backport - uses: VachaShah/backport@v1.1.4 + - uses: VachaShah/backport@v2 with: - github_token: ${{ steps.github_app_token.outputs.token }} - branch_name: backport/backport-${{ github.event.number }} + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file