Skip to content

Approve test changes

Label and approve PRs that only include tests, and post an explanation comment.

Adding tests example

Configuration Description

Conditions (all must be true):

  • The PR only contains changes to tests

Automation Actions:

  • Add a tests-only label
  • Approve the PR
  • Post a comment that explains why the PR was approved.

Approve Tests

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  approve_tests:
    if:
      # Triggered for PRs that only include changes to tests
      - {{ files | allTests }}
    run: 
      - action: add-label@v1
        args:
          label: 'tests-only'
      - action: add-comment@v1
        args:
          comment: |
            This merge has been automatically approved because it only contains changes to tests.
      - action: approve@v1

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.