Skip to content

Commit

Permalink
docs: describe required permissions (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchabr authored May 10, 2023
1 parent 7a3f637 commit aa8cbdd
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 12 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/label-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Labels Check

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]

jobs:
QA-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
hasSome: QA:tested,QA:skipped
githubToken: ${{ secrets.GITHUB_TOKEN }}
Do_not_merge-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
hasNone: do not merge,blocked
githubToken: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ Github Action to check if a PR's labels pass the specified rules
## Output
- `passed`: boolean

## Permissions
If you have customized permissions for your GitHub token you will need to manually add these permissions for this action:
```
permissions:
pull-requests: read
checks: write
```
More info on the syntax: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions

## Example workflow file
```yml
name: Labels Check
Expand Down
24 changes: 12 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: 'PR labels checker'
description: 'Checks PR labels for specified rules'
name: "PR labels checker"
description: "Checks PR labels for specified rules"
inputs:
hasSome:
description: 'Comma separated list of labels, PR needs at least of them'
description: "Comma separated list of labels, PR needs at least of them"
required: false
hasAll:
description: 'Comma separated list of labels, PR needs all of them'
description: "Comma separated list of labels, PR needs all of them"
required: false
hasNone:
description: 'Comma separated list of labels, PR must not have any of them'
description: "Comma separated list of labels, PR must not have any of them"
required: false
hasNotAll:
description: 'Comma separated list of labels, PR must not have all of them'
description: "Comma separated list of labels, PR must not have all of them"
required: false
githubToken:
description: 'The Github secret token to access PR check API'
description: "The Github secret token to access PR check API"
required: true
outputs:
passed:
description: 'Have the provided labels passed all tests?'
description: "Have the provided labels passed all tests?"
runs:
using: 'node12'
main: 'index.js'
using: "node12"
main: "index.js"
branding:
icon: 'tag'
color: 'blue'
icon: "tag"
color: "blue"

0 comments on commit aa8cbdd

Please sign in to comment.