Skip to main content
Version: 3.10.0

Label based on author groups

Here's an example of a reviewpad.yml configuration that labels pull requests authored by a member of a group of developers.

Suppose that, as Spotify, you consider developers new joiner until they create/merge their 10th pull request. Each time a new joiner creates a pull request, you want to label it in order to be able to perform a dedicated code review process. Using Reviewpad groups you can easily do such labeling.

api-version: reviewpad.com/v3.x

labels:
new-joiner:
description: Pull requests created by new joiners
# color is the hexadecimal color code for the label, without the leading #.
color: 294b69

groups:
- name: new-joiners
description: Group of developers that have created less than 10 pull requests
kind: developers
type: filter
param: developer
where: '$pullRequestCountBy($developer, "all") < 10'

rules:
- name: authored-by-new-joiner
kind: patch
description: Patch authored by new joiner
spec: '$isElementOf($author(), $group("new-joiners"))'

workflows:
- name: critical
description: Modifications by new joiners require careful review
if:
- rule: authored-by-new-joiner
then:
- '$addLabel("new-joiner")'