Skip to content

Enforce Required Labels

Automatically enforce the use of required PR labels.

Enforce Required 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:

More Automations can be found on the Automation Library and Integrations pages.