-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (29 loc) · 1.39 KB
/
check_pr_labels.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
name: "Check Merge-able by label ✅"
on:
pull_request:
types:
- opened
- reopened
- synchronize
- edited
- labeled
- unlabeled
jobs:
fail-by-label:
runs-on: ubuntu-22.04
steps:
- name: Fail if PR is labeled "do-not-merge"
if: contains(github.event.pull_request.labels.*.name, 'do-not-merge')
run: |
echo "This PR is labeled as do-not-merge!"
exit 1
- name: Fail if PR doesn't have SemVer label
if: "!contains(github.event.pull_request.labels.*.name, 'semver:major') && !contains(github.event.pull_request.labels.*.name, 'semver:minor') && !contains(github.event.pull_request.labels.*.name, 'semver:patch') && !contains(github.event.pull_request.labels.*.name, 'semver:none')"
run: |
echo "Every PR needs a semver label!"
exit 1
- name: Fail if PR doesn't have kind label
if: "!contains(github.event.pull_request.labels.*.name, 'kind:feature') && !contains(github.event.pull_request.labels.*.name, 'kind:enhancement') && !contains(github.event.pull_request.labels.*.name, 'kind:fix') && !contains(github.event.pull_request.labels.*.name, 'kind:bugfix') && !contains(github.event.pull_request.labels.*.name, 'kind:chore') && !contains(github.event.pull_request.labels.*.name, 'kind:dependencies')"
run: |
echo "Every PR needs a kind label!"
exit 1