diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml new file mode 100644 index 000000000..89bfd92a3 --- /dev/null +++ b/.github/workflows/backport.yaml @@ -0,0 +1,31 @@ +name: Automated Backporting + +on: + pull_request_target: + types: + - closed + branches: + - main + +jobs: + create_backport: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - if: contains(github.event.pull_request.labels.*.name, '13.x') + name: 13.x Backport + uses: kiegroup/git-backporting@v4.2.0 + with: + target-branch: 13.x + pull-request: ${{ github.event.pull_request.url }} + auth: ${{ secrets.GITHUB_TOKEN }} + no-squash: true + + - if: contains(github.event.pull_request.labels.*.name, '14.x') + name: 14.x Backport + uses: kiegroup/git-backporting@v4.2.0 + with: + target-branch: 14.x + pull-request: ${{ github.event.pull_request.url }} + auth: ${{ secrets.GITHUB_TOKEN }} + no-squash: true diff --git a/.github/workflows/backport_reaper.yaml b/.github/workflows/backport_reaper.yaml new file mode 100644 index 000000000..7b664b0c3 --- /dev/null +++ b/.github/workflows/backport_reaper.yaml @@ -0,0 +1,19 @@ +name: Backport branch reaper + +on: + pull_request_target: + types: + - closed + branches: + - '*.x' + +jobs: + remove_backport_branch: + if: startsWith(github.event.pull_request.head.ref, 'bp-') + runs-on: ubuntu-latest + steps: + - name: Delete PR head branches + uses: dawidd6/action-delete-branch@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + numbers: ${{github.event.pull_request.number}}