forked from StarRocks/starrocks
-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (81 loc) · 3.22 KB
/
pr-checker.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: PR CHECKER
on:
pull_request_target:
branches:
- main
- branch-2.3
- branch-2.4
- branch-2.5
- branch-3.0
types:
- opened
- reopened
- edited
jobs:
title-check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: ".github/pr-title-checker-config.json"
branch-info-check:
needs: title-check
runs-on: ubuntu-latest
if: >
(startsWith(github.event.pull_request.title, '[BugFix]') ||
startsWith(github.event.pull_request.title, '[Enhancement]'))&&
!contains(github.event.pull_request.title, 'cherry-pick') &&
!contains(github.event.pull_request.title, 'backport')
steps:
- name: add branch-3.0 label
if: contains(toJson(github.event.pull_request.body), '[x] 3.0')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: '3.0'
- name: add branch-2.5 label
if: contains(toJson(github.event.pull_request.body), '[x] 2.5')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: '2.5'
- name: add branch-2.4 label
if: contains(toJson(github.event.pull_request.body), '[x] 2.4')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: '2.4'
- name: add branch-2.3 label
if: contains(toJson(github.event.pull_request.body), '[x] 2.3')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: '2.3'
- name: remove branch-3.0 label
if: contains(toJson(github.event.pull_request.body), '[ ] 3.0') && contains(github.event.pull_request.labels.*.name, '3.0')
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: '3.0'
- name: remove branch-2.5 label
if: contains(toJson(github.event.pull_request.body), '[ ] 2.5') && contains(github.event.pull_request.labels.*.name, '2.5')
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: '2.5'
- name: remove branch-2.4 label
if: contains(toJson(github.event.pull_request.body), '[ ] 2.4') && contains(github.event.pull_request.labels.*.name, '2.4')
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: '2.4'
- name: remove branch-2.3 label
if: contains(toJson(github.event.pull_request.body), '[ ] 2.3') && contains(github.event.pull_request.labels.*.name, '2.3')
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: '2.3'
- name: check-done
if: >
(startsWith(github.event.pull_request.title, '[BugFix]') ||
startsWith(github.event.pull_request.title, '[Enhancement]'))&&
!contains(github.event.pull_request.title, 'cherry-pick') &&
!contains(github.event.pull_request.title, 'backport') &&
contains(toJson(github.event.pull_request.body), '[ ] I have checked the version labels')
run: |
echo "You must mark this checkbox - I have checked the version labels which the pr will be auto backported to target branch"
exit 1