https://github.com/riot-os/check-labels-action
Action that checks the labels of a Pull Request and will succeed or fail based on the configuration.
https://github.com/riot-os/check-labels-action
checker github github-actions github-labels labels
Last synced: about 1 month ago
JSON representation
Action that checks the labels of a Pull Request and will succeed or fail based on the configuration.
- Host: GitHub
- URL: https://github.com/riot-os/check-labels-action
- Owner: RIOT-OS
- License: mit
- Created: 2020-08-25T17:30:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-05T08:12:25.000Z (12 months ago)
- Last Synced: 2025-03-26T11:21:26.725Z (about 2 months ago)
- Topics: checker, github, github-actions, github-labels, labels
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 29
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Check Labels Action
===================This action checks the labels of a Pull Request and will succeed or fail based
on the configuration.Inputs
------### `access_token`
An optional [personal access token], required for private repositories and to
decrease rate limiting.[personal access token]: https://github.com/settings/tokens
### `set_labels`
Comma-separated list of labels required to be set. Optional. Globing syntax is
possible for the label name, as defined in [fnmatch].### `unset_labels`
Comma-separated list of labels required not to be set. Optional. Globing syntax
is possible for the label name, as defined in [fnmatch].### `cond_labels`
Comma-separated list of (label,condition) tuples for labels introducing a
condition. Optional. Globing syntax is possible for the label name, as defined
in [fnmatch].### `missing_approvals_label`
Name of a label that this action will set/unset according to the state of
required approvals. The label will be set if approvals are missing, and unset
if there are sufficient approvals.#### Supported conditions
- `review.approvals>x`: If the label is set in the Pull Request it requires more
than `x` approving reviews for the action to succeed[fnmatch]: https://docs.python.org/3/library/fnmatch.html
# Examples
We recommend the following workflow triggers:
```yml
on:
pull_request:
types: [opened, reopened, labeled, unlabeled]
pull_request_review:
types: [submitted, dismissed]
```The action will fail if "REQUIRE" and "MANDATORY" are not set, if any label
starting with "INVALID" is set, or if "NEEDS >1 ACK" is set, but the PR only has
one or no approval:```yml
uses: RIOT-OS/[email protected]
with:
access_token: '${{ secrets.GITHUB_ACCESS_TOKEN }}'
set_labels: 'REQUIRE, MANDATORY'
unset_labels: 'INVALID*'
cond_labels: '(NEEDS >1 ACK,review.approvals > 1)'
```