From 5e26e504086a1296e058900149abacee920e0b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sun, 19 Jul 2026 13:35:17 -0300 Subject: [PATCH] ci: automate backports to release branches Label a PR 'backport ' (e.g. 'backport 2.18') and, once it merges, this workflow cherry-picks the PR's commits onto that branch and opens the backport PR automatically. Labeling an already-merged PR triggers it retroactively. On cherry-pick conflict the action comments on the original PR so the backport can be done by hand. --- .github/workflows/backport.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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 000000000..e7f1fcd95 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,23 @@ +name: backport +on: + pull_request_target: + types: [closed, labeled] + +permissions: + contents: write + pull-requests: write + +jobs: + backport: + name: Backport merged PR + runs-on: ubuntu-latest + if: > + github.event.pull_request.merged == true && + ( + github.event.action == 'closed' || + startsWith(github.event.label.name, 'backport ') + ) + steps: + - uses: actions/checkout@v6 + - name: Create backport pull requests + uses: korthout/backport-action@v3