forked from StarRocks/starrocks
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.98 KB
/
checkmate.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
name: checkbox
on:
pull_request_target:
types: [edited, opened, reopened]
jobs:
checkmate:
runs-on: ubuntu-latest
steps:
# - name: Dump GitHub event
# env:
# GITHUB_CONTEXT: ${{ toJson(github.event.pull_request.body) }}
# run:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Commit Message
run: |
MSG=$(git log --format=%B ${{github.event.after}})
echo $MSG
- name: get issue number
if: contains(toJson(github.event.pull_request.body), 'Fixes ')
id: issue
run: |
number=$(echo -e ${{ toJson(github.event.pull_request.body) }} | grep 'Fixes #11' | cut -d ' ' -f 2)
echo $number
echo "result=$number" >> $GITHUB_OUTPUT
- name: echo result
if: steps.issue.outputs.result != ''
run: echo ${{ steps.issue.outputs.result }}
- name: feature
# if: contains(toJson(github.event.pull_request.body), '[x] Feature')
env:
GITHUB_CONTEXT1: ${{ toJson(github.event.changes.body) }}
GITHUB_CONTEXT2: ${{ toJson(github.event.pull_request.body) }}
run: |
echo ${{ toJson(github.event.pull_request.body) }}
#echo "$GITHUB_CONTEXT1"
# echo "$GITHUB_CONTEXT2"
- name: add branch-2.5 label
if: >
contains(toJson(github.event.pull_request.body), '[x] 2.5') &&
contains(toJson(github.event.changes.body), '[ ] 2.5')
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: |
2.5
- name: add branch-2.4 label
if: >
contains(toJson(github.event.pull_request.body), '[x] 2.4') &&
contains(toJson(github.event.changes.body), '[ ] 2.4')
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: |
2.4
- name: check-done
if: >
contains(toJson(github.event.pull_request.body), '[ ] I have checked the version labels which the pr will be auto backported to target branch')
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
# if [[ "\r\n- [x] Feature\r\n" == *"[x] Feature"* ]]; then echo "ok"; fi
#echo "$GITHUB_CONTEXT"
# - uses: actions/checkout@v3
# - uses: kentaro-m/[email protected]
# with:
# repo-token: "${{ secrets.GITHUB_TOKEN }}"
# - name: Validate Checklists
# if: >
# startsWith(github.event.pull_request.title, '[BugFix]') &&
# !contains(github.event.pull_request.title, 'cherry-pick') &&
# !contains(github.event.pull_request.title, 'backport')
# uses: roryq/checkmate@master