-
Notifications
You must be signed in to change notification settings - Fork 86
58 lines (53 loc) · 2.17 KB
/
semver_label_check.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
name: validate pr labels
on:
pull_request_target:
types: [labeled, unlabeled, opened, reopened, synchronize, ready_for_review]
jobs:
check-pr:
name: Validate Release Labels
runs-on: ubuntu-20.04
steps:
# ensure that a semantic version label is present
- name: check_semver_labels
if: >
!(contains(github.event.pull_request.labels.*.name, 'semver:feature')
|| contains(github.event.pull_request.labels.*.name, 'semver:patch'))
uses: actions/github-script@v3
with:
script: |
core.setFailed('No semver label was found on this PR!')
# ensure that the 'for next beta' label is not present
- name: check_for_next_beta_labels
if: >
contains(github.event.pull_request.labels.*.name, 'for next beta')
uses: actions/github-script@v3
with:
script: |
core.setFailed('This PR is labeled to wait until next beta cycle for release.')
# ensure that this is not an unfinished change
- name: check_draft_label
if: >
contains(github.event.pull_request.labels.*.name, 'draft')
uses: actions/github-script@v3
with:
script: |
core.setFailed('This change is still under construction.')
# ensure that this change is not under active discussion
- name: check_discussion_label
if: >
contains(github.event.pull_request.labels.*.name, 'discussion ongoing')
uses: actions/github-script@v3
with:
script: |
core.setFailed('This change has not yet been agreed upon.')
# ensure that this is not a character change waiting for balance approval
- name: check_balance_labels
if: >
contains(github.event.pull_request.labels.*.name, 'character change')
&& !contains(github.event.pull_request.labels.*.name, 'balance approved')
uses: actions/github-script@v3
with:
script: |
core.setFailed('This character change has not been approved for balance yet.')
- name: all_is_well
run: echo "This PR is in an appropriately labeled state."