Skip to content

Commit aa8cbdd

Browse files
authored
docs: describe required permissions (#12)
1 parent 7a3f637 commit aa8cbdd

File tree

3 files changed

+44
-12
lines changed

3 files changed

+44
-12
lines changed

.github/workflows/label-check.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Labels Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, labeled, unlabeled, synchronize]
6+
7+
jobs:
8+
QA-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: ./
13+
with:
14+
hasSome: QA:tested,QA:skipped
15+
githubToken: ${{ secrets.GITHUB_TOKEN }}
16+
Do_not_merge-check:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: ./
21+
with:
22+
hasNone: do not merge,blocked
23+
githubToken: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ Github Action to check if a PR's labels pass the specified rules
1111
## Output
1212
- `passed`: boolean
1313

14+
## Permissions
15+
If you have customized permissions for your GitHub token you will need to manually add these permissions for this action:
16+
```
17+
permissions:
18+
pull-requests: read
19+
checks: write
20+
```
21+
More info on the syntax: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions
22+
1423
## Example workflow file
1524
```yml
1625
name: Labels Check

action.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
name: 'PR labels checker'
2-
description: 'Checks PR labels for specified rules'
1+
name: "PR labels checker"
2+
description: "Checks PR labels for specified rules"
33
inputs:
44
hasSome:
5-
description: 'Comma separated list of labels, PR needs at least of them'
5+
description: "Comma separated list of labels, PR needs at least of them"
66
required: false
77
hasAll:
8-
description: 'Comma separated list of labels, PR needs all of them'
8+
description: "Comma separated list of labels, PR needs all of them"
99
required: false
1010
hasNone:
11-
description: 'Comma separated list of labels, PR must not have any of them'
11+
description: "Comma separated list of labels, PR must not have any of them"
1212
required: false
1313
hasNotAll:
14-
description: 'Comma separated list of labels, PR must not have all of them'
14+
description: "Comma separated list of labels, PR must not have all of them"
1515
required: false
1616
githubToken:
17-
description: 'The Github secret token to access PR check API'
17+
description: "The Github secret token to access PR check API"
1818
required: true
1919
outputs:
2020
passed:
21-
description: 'Have the provided labels passed all tests?'
21+
description: "Have the provided labels passed all tests?"
2222
runs:
23-
using: 'node12'
24-
main: 'index.js'
23+
using: "node12"
24+
main: "index.js"
2525
branding:
26-
icon: 'tag'
27-
color: 'blue'
26+
icon: "tag"
27+
color: "blue"

0 commit comments

Comments
 (0)