File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Force-Label
2
2
Github Action that forces developers to add labels to their PR before it is merged.
3
+
4
+ ## Required Labels
5
+ To have multiple required labels you can use ` || ` :
6
+
7
+ ```
8
+ jobs:
9
+ check-labels:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - name: Labels not added (bug, documentation, enhancement)
14
+ if: >
15
+ contains(github.event.pull_request.labels.*.name, 'bug') == false ||
16
+ contains(github.event.pull_request.labels.*.name, 'allocations') == false ||
17
+ contains(github.event.pull_request.labels.*.name, 'fe') == false
18
+ run: exit 1
19
+ ```
20
+
21
+ ## Layered Labels
22
+ To require labels specific to parent labels you can use ` needs `
23
+
24
+ ```
25
+ jobs:
26
+ check-bug:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v3
30
+ - name: Labels not added (bug)
31
+ if: >
32
+ contains(github.event.pull_request.labels.*.name, 'bug') == false &&
33
+ run: exit 1
34
+
35
+ check-sev:
36
+ runs-on: ubuntu-latest
37
+ needs: check-bug
38
+ steps:
39
+ - uses: actions/checkout@v3
40
+ - name: Labels not added (sev1, sev2, sev3)
41
+ if: >
42
+ contains(github.event.pull_request.labels.*.name, 'sev1') == false &&
43
+ contains(github.event.pull_request.labels.*.name, 'sev2') == false &&
44
+ contains(github.event.pull_request.labels.*.name, 'sev3') == false
45
+ run: exit 1
46
+ ```
You can’t perform that action at this time.
0 commit comments