From 938010eed0e660131b257c8c9d205e072e759b6b Mon Sep 17 00:00:00 2001 From: Amit Sahastrabuddhe Date: Thu, 3 Oct 2024 12:12:14 +0530 Subject: [PATCH 1/2] 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 From 1f3752d3820dde4e1bf9669f6e436c76e647d562 Mon Sep 17 00:00:00 2001 From: Amit Sahastrabuddhe <33931378+AmitSahastra@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:40:44 +0530 Subject: [PATCH 2/2] Update .backportrc.json --- .backportrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.backportrc.json b/.backportrc.json index 661f2998b53b..5cb2ef077652 100644 --- a/.backportrc.json +++ b/.backportrc.json @@ -1,6 +1,6 @@ { "repoOwner": "spectrocloud", - "repoName": "palette", + "repoName": "cluster-api", "editor": "code", "targetBranchChoices": ["spectro-master", "spectro-release-4.5"],