Skip to content

Assign Reviewers by Directory

Automatically assign code reviewers based on directory structure. Optionally, you can substitue require-reviewers for add-reviewers to make review from the specified teams and individuals mandatory.

Assign Reviewers by Directory

Conditions (all must be true):

  • The PR contains changes to JavaScript files inside the src/ui directory.

Automation Actions:

  • Add a user named my-teamate and a team named my-organization/ui-team as reviewers. These should be customized to match your organization.
  • Post a comment explaining why these reviewers were assigned.

Assign Reviewers by Directory

# -*- mode: yaml -*-

  version: 1.0

    # Triggered for PRs that contain any changes to JavaScript files inside the `src/ui` directory.
      - {{ files | match(regex=r/src\/app\/auth\/.*/) | some}}
    # Add a specified user and team as reviewers.
    # Customize the reviewers to match your organization
      - action: add-reviewers@v1
          reviewers: [my-teamate, my-organization/security]
      - action: add-comment@v1
          comment: |
            The Security team has automatically been added for review because this PR contains changes to components inside `/src/app/auth`