diff --git a/.backportrc.json b/.backportrc.json new file mode 100644 index 000000000000..5cb2ef077652 --- /dev/null +++ b/.backportrc.json @@ -0,0 +1,15 @@ +{ + "repoOwner": "spectrocloud", + "repoName": "cluster-api", + "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