-
Notifications
You must be signed in to change notification settings - Fork 30
49 lines (45 loc) · 1.61 KB
/
backport.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Pull Request Backporting using Git Backporting
on:
pull_request_target:
types:
- closed
- labeled
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NO_SQUASH_OPTION: true
jobs:
backporting:
name: "Backporting"
concurrency:
group: backporting-${{ github.head_ref }}
cancel-in-progress: true
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged && (
github.event.action == 'closed'
&& (contains(github.event.pull_request.labels.*.name, 'backport')
|| contains(github.event.pull_request.labels.*.name, 'backport-squash'))
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
runs-on: ubuntu-latest
steps:
- name: Override no-squash option
if: >
(github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'backport-squash')) || (github.event.action == 'labeled' && contains(github.event.label.name, 'backport-squash'))
shell: bash
run: |
echo "NO_SQUASH_OPTION=false" >> $GITHUB_ENV
- name: Backporting
uses: kiegroup/git-backporting@v4
with:
target-branch: 0.15
pull-request: ${{ github.event.pull_request.url }}
auth: ${{ secrets.RH_PERF_BOT_TOKEN }}
no-squash: ${{ env.NO_SQUASH_OPTION }}
strategy: ort
strategy-option: ours
enable-err-notification: true