Enforce Required Labels
Automatically enforce the use of required PR labels.
Configuration Description
Conditions (all must be true):
- The PR lacks one or more labels from a list of required labels.
Automation Actions:
- Apply a
Missing Required Labels
label. - Post a comment explaining why the label was applied and which labels are required.
Enforce Required Labels
manifest:
version: 1.0
automations:
enforce_required_labels:
if:
- {{ pr.labels | match(list=['Core', 'Mobile', 'UI']) | nope }}
run:
- action: request-changes@v1
args:
comment: Please ensure that your PR is labeled with either 'Core', 'Mobile', or 'UI'. These labels help us to better track and manage your contribution. Thank you.
Additional Resources
gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.
Learn More about how gitStream Works.
Related Automations:
- Estimate the amount of time it would require someone to complete a PR review.
- Flag missing Jira ticket information
- Label PRs that delete files.
- Label PRs that lack tests
- Provide information about what percent of a PR is new code.
- Request PR authors to provide screenshots in relevant PRs.
More Automations can be found on the Automation Library and Integrations pages.