diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml index 307fa037359..0e7696f3b89 100644 --- a/.github/workflows/backport.yaml +++ b/.github/workflows/backport.yaml @@ -15,26 +15,19 @@ jobs: if: > github.event.pull_request.merged && ( - (github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'backport/')) + github.event.action == 'closed' || (github.event.action == 'labeled' && contains(github.event.label.name, 'backport/') ) ) steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - # This workflow requires a non-GHA token in order to trigger downstream CI, and to access the 'fork' repository. - - uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1 + - uses: actions/create-github-app-token@7bfa3a4717ef143a604ee0a99d859b8886a96d00 # v1.9.3 id: app-token with: app-id: ${{ secrets.POETRY_TOKEN_APP_ID }} private-key: ${{ secrets.POETRY_TOKEN_APP_KEY }} - - name: backport.sh - run: | - git config --global user.name "${{ steps.app-token.outputs.slug }}[bot]" - git config --global user.email "${{ steps.app-token.outputs.slug }}[bot]@users.noreply.github.com" - - gh repo fork --remote-name fork - - ./.github/scripts/backport.sh --pr ${{ github.event.pull_request.number }} --comment --remote fork - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} + - uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4 + with: + github_token: ${{ steps.app-token.outputs.token }} + title_template: "[<%= base %>] <%= title %>" + label_pattern: "^backport/(?([^ ]+))$"