diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f10d3d09..df7cf346 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -11,6 +11,15 @@ jobs: permissions: contents: write pull-requests: write + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) name: Backport steps: - name: GitHub App token @@ -24,4 +33,4 @@ jobs: uses: VachaShah/backport@v2.2.0 with: github_token: ${{ steps.github_app_token.outputs.token }} - branch_name: backport/backport-${{ github.event.number }} + head_template: backport/backport-<%= number %>-to-<%= base %>