Skip to content

Commit

Permalink
Add backport GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson authored and karesti committed Sep 15, 2023
1 parent 167e04a commit 99553fd
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
with:
target-branch: 14.x
pull-request: ${{ github.event.pull_request.url }}
auth: ${{ secrets.GITHUB_TOKEN }}
no-squash: true
19 changes: 19 additions & 0 deletions .github/workflows/backport_reaper.yaml
Original file line number Diff line number Diff line change
@@ -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}}

0 comments on commit 99553fd

Please sign in to comment.