-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (48 loc) · 1.46 KB
/
classify.yaml
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
name: Add Labels
on:
pull_request_target:
types: [opened, edited]
jobs:
add_labels:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: |
kind/api-change
kind/bug
kind/cleanup
kind/deprecation
kind/design
kind/documentation
kind/failing
kind/feature
kind/flake
kind/regression
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.event.pull_request.body }}
regex: '(?<!> )\/kind (\w+)'
- name: Check
run: |
if [[ ! "${{ steps.regex-match.outputs.group1 }}" =~ ^(api-change|bug|cleanup|deprecation|design|documentation|failing|feature|flake|regression)$ ]]; then
echo "kind must belong to
- api-change \
- bug \
- cleanup \
- deprecation \
- design \
- documentation \
- failing \
- feature \
- flake \
- regression \
please add /kind [type] to the body of the PR"
exit 1
fi
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: kind/${{ steps.regex-match.outputs.group1 }}