Skip to content

Assign Code Experts

When someone applies a suggest-reviewers label to a PR, use codeExperts to assign recommended reviewers and post a comment with the explainCodeExperts automation action.

Assign Code Experts

Conditions (all must be true):

  • The PR has a suggest-reviewers label attached to it.

Automation Actions:

  • Use codeExperts to assign recommended reviewers.
  • Use explainCodeExperts to post a comment that lists the top code experts for the PR.

Assign Code Experts

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  assign_code_experts:
    # Triggered when someone applies a suggest-reviewer label to a PR.
    if: 
      - {{ pr.labels | match(term='suggest-reviewer') }}
    # Identify the best experts to assign for review and post a comment that explains why
    # More info about code experts
    # https://docs.gitstream.cm/filter-functions/#codeexperts
    run:
      - action: add-reviewers@v1
        args:
          reviewers: {{ repo | codeExperts(gt=10) }}
      - action: add-comment@v1
        args:
          comment: |
            {{ repo | explainCodeExperts(gt=10) }}