Skip to content

Commit bc676cd

Browse files
authored
Added PR Backporting action (#368)
Signed-off-by: Helber Belmiro <[email protected]>
1 parent 7965b32 commit bc676cd

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Pull Request Backporting
2+
3+
on:
4+
pull_request_target:
5+
types: [closed, labeled]
6+
env:
7+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8+
9+
jobs:
10+
compute-targets:
11+
if: ${{ github.event.pull_request.state == 'closed' && github.event.pull_request.merged }}
12+
runs-on: ubuntu-latest
13+
outputs:
14+
target-branches: ${{ steps.set-targets.outputs.targets }}
15+
env:
16+
LABELS: ${{ toJSON(github.event.pull_request.labels) }}
17+
steps:
18+
- name: Set target branches
19+
id: set-targets
20+
uses: kiegroup/kie-ci/.ci/actions/parse-labels@main
21+
with:
22+
labels: ${LABELS}
23+
24+
backporting:
25+
if: ${{ github.event.pull_request.state == 'closed' && github.event.pull_request.merged && needs.compute-targets.outputs.target-branches != '[]' }}
26+
name: "[${{ matrix.target-branch }}] - Backporting"
27+
runs-on: ubuntu-latest
28+
needs: compute-targets
29+
strategy:
30+
matrix:
31+
target-branch: ${{ fromJSON(needs.compute-targets.outputs.target-branches) }}
32+
fail-fast: false
33+
env:
34+
REVIEWERS: ${{ toJSON(github.event.pull_request.requested_reviewers) }}
35+
steps:
36+
- name: Backporting
37+
uses: kiegroup/kie-ci/.ci/actions/backporting@main
38+
with:
39+
target-branch: ${{ matrix.target-branch }}

0 commit comments

Comments
 (0)