From 80c6a1ce72877dec3574ff21455f93203853a9b9 Mon Sep 17 00:00:00 2001 From: An Tran Date: Tue, 10 Jun 2025 12:04:27 +1000 Subject: [PATCH] Introduce backport GH action --- .github/workflows/backport.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 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..4b0fad9b9 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,35 @@ +name: Backport +on: + pull_request: + types: [closed, labeled] + permissions: + contents: write # so it can comment + pull-requests: write # so it can create pull requests + actions: write +jobs: + backport: + name: Backport + runs-on: ubuntu-latest + if: github.event.pull_request.merged + steps: + - uses: actions/checkout@v4 + - name: Create backport pull requests + uses: korthout/backport-action@924c8170740fa1e3685f69014971f7f251633f53 # v2.4.1 + id: backport + with: + pull_title: '[backport -> ${target_branch}] ${pull_title}' + merge_commits: 'skip' + copy_labels_pattern: ^(?!backport ).* # copies all labels except those starting with "backport " + label_pattern: ^backport (3scale\/[^ ]+)$ # filters for labels starting with "backport " and extracts the branch name + pull_description: |- + Automated backport to `${target_branch}`, triggered by a label in #${pull_number}. + + ## Original description + + ${pull_description} + copy_assignees: true + copy_requested_reviewers: true + experimental: > + { + "detect_merge_method": true + }