From c189f3c0a35966318cdf6f6ddfdba007d6b1f18b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Dec 2024 22:53:40 +0000 Subject: [PATCH] Fix backport workflow (#315) Signed-off-by: Thomas Farr (cherry picked from commit 96435beb976343bc916e0aeae120931ec0dad998) Signed-off-by: github-actions[bot] --- .github/workflows/backport.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 %>