Skip to content

Commit b3d93a0

Browse files
authored
Update README.md
1 parent 5ae83cd commit b3d93a0

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

README.md

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
# Force-Label
22
Github Action that forces developers to add labels to their PR before it is merged.
33

4+
# Customize Labels
5+
To customize labels, simply add/remove from the list:
6+
```
7+
if: >
8+
contains(github.event.pull_request.labels.*.name, 'bug') == false &&
9+
contains(github.event.pull_request.labels.*.name, 'documentation') == false &&
10+
contains(github.event.pull_request.labels.*.name, 'enhancement') == false &&
11+
contains(github.event.pull_request.labels.*.name, 'newlabel1') == false &&
12+
contains(github.event.pull_request.labels.*.name, 'newlabel2') == false
13+
run: exit 1
14+
```
15+
This will require either `bug`, `documentation`, `enhancement`, `newlabel1`, or `newlabel2` to be attached to a PR.
16+
417
## Required Labels
5-
To have multiple required labels you can use `||`:
18+
To have multiple required labels on a single PR you can use `||`:
619

720
```
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)
1421
if: >
1522
contains(github.event.pull_request.labels.*.name, 'bug') == false ||
1623
contains(github.event.pull_request.labels.*.name, 'allocations') == false ||
1724
contains(github.event.pull_request.labels.*.name, 'fe') == false
1825
run: exit 1
1926
```
2027

21-
## Layered Labels
22-
To require labels specific to parent labels you can use `needs`
28+
## Related Labels
29+
To require labels related to other labels you can use `needs` on a specific job.
2330

2431
```
2532
jobs:

0 commit comments

Comments
 (0)