Skip to content

Label PRs Without Tests

Apply a missing-tests label to any PRs that don't update tests. gitStream will remove this label if the contributor adds a test change to the PR.

Automation Name

Configuration Description

Conditions (all must be true):

  • The PR has no changes to a test.

Automation Actions:

  • Apply a missing-tests label.

Label PRs Without Tests

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  label_prs_without_tests:
    if:
      - {{ files | match(regex=r/[^a-zA-Z0-9](spec|test|tests)[^a-zA-Z0-9]/) | nope }}
    run: 
      - action: add-label@v1
        args:
          label: 'missing-tests'
          color: '#E94637'

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.