From 571afe6dbc2b1e08c1a429637f508c1706413766 Mon Sep 17 00:00:00 2001 From: Amit Sahastrabuddhe Date: Thu, 3 Oct 2024 12:12:14 +0530 Subject: [PATCH] add backport action to cluster-api --- .backportrc.json | 15 +++++++++++++++ .github/workflows/backport.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .backportrc.json create mode 100644 .github/workflows/backport.yaml diff --git a/.backportrc.json b/.backportrc.json new file mode 100644 index 000000000000..661f2998b53b --- /dev/null +++ b/.backportrc.json @@ -0,0 +1,15 @@ +{ + "repoOwner": "spectrocloud", + "repoName": "palette", + "editor": "code", + + "targetBranchChoices": ["spectro-master", "spectro-release-4.5"], + "mainline": 1, + "autoMerge": false, + "autoMergeMethod": "squash", + "targetPRLabels": ["ok-to-test"], + "commitConflicts": true, + "branchLabelMapping": { + "^backport-(.+)$": "$1" + } +} diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml new file mode 100644 index 000000000000..fe5aa0781664 --- /dev/null +++ b/.github/workflows/backport.yaml @@ -0,0 +1,32 @@ +name: Backport + +on: + pull_request_target: + types: ["labeled", "closed"] + +jobs: + backport: + name: Backport PR + runs-on: ubuntu-latest + if: | + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'auto-backport') + && ( + (github.event.action == 'labeled' && github.event.label.name == 'auto-backport') + || (github.event.action == 'closed') + ) + steps: + - name: Backport Action + uses: sqren/backport-github-action@v9.2.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + auto_backport_label_prefix: backport- + add_original_reviewers: true + + - name: Info log + if: ${{ success() }} + run: cat ~/.backport/backport.info.log + + - name: Debug log + if: ${{ failure() }} + run: cat ~/.backport/backport.debug.log