reviewpad.yml
# This file is used to configure Reviewpad.
# The configuration is a proposal to help you get started.
# You can use it as a starting point and customize it to your needs.
# For more details see https://docs.reviewpad.com/guides/syntax.
# Define the list of labels to be used by Reviewpad.
# For more details see https://docs.reviewpad.com/guides/syntax#label.
labels:
small:
description: Pull request is small
color: "#76dbbe"
medium:
description: Pull request is medium
color: "#2986cc"
large:
description: Pull request is large
color: "#c90076"
# Define the list of workflows to be run by Reviewpad.
# A workflow is a list of actions that will be executed based on the defined rules.
# For more details see https://docs.reviewpad.com/guides/syntax#workflow.
workflows:
# This workflow calls Reviewpad AI agent to summarize the pull request.
- name: summarize
description: Summarize the pull request
always-run: true
if:
# Summarize the pull request on pull request creation.
- rule: $eventType() == "opened"
extra-actions:
- $summarize()
# This workflow validates best practices for pull request management.
# This helps developers follow best practices.
- name: best-practices
description: Validate best practices for pull request management
always-run: true
if:
# Warn pull requests that do not have an associated GitHub issue.
- rule: $hasLinkedIssues() == false
extra-actions:
- $warn("Please link an issue to the pull request")
# This workflow labels pull requests based on the total number of lines changed.
# This helps pick pull requests based on their size and to incentivize small pull requests.
- name: size-labeling
description: Label pull request based on the number of lines changed
always-run: true
if:
- rule: $size() < 100
extra-actions:
- $removeLabels(["medium", "large"])
- $addLabel("small")
- rule: $size() >= 100 && $size() < 300
extra-actions:
- $removeLabels(["small", "large"])
- $addLabel("medium")
- rule: $size() >= 300
extra-actions:
- $removeLabels(["small", "medium"])
- $addLabel("large")
# This workflow signals pull requests waiting for reviews.
# This helps guarantee that pull requests are reviewed and approved by at least one person.
- name: check-approvals
description: Check that pull requests have the required number of approvals
always-run: true
if:
# Label pull requests with `waiting-for-review` if there are no approvals;
- rule: $isDraft() == false && $approvalsCount() < 1
extra-actions:
- $addLabel("waiting-for-review")
# This workflow labels pull requests based on the pull request change type.
# This helps pick pull requests based on their change type.
- name: change-type-labelling
description: Label pull requests based on the type of changes
always-run: true
if:
# Label pull requests with `docs` if they only modify Markdown or txt files.
- rule: $hasFileExtensions([".md", ".txt"])
extra-actions:
- $addLabel("docs")
# Label pull requests with `infra` if they modify Terraform files.
- rule: $hasFileExtensions([".tf"])
extra-actions:
- $addLabel("infra")
# Label pull requests with `dependencies` if they only modify `package.json` and `package.lock` files.
- rule: $hasFileExtensions(["package.json", "package-lock.json"])
extra-actions:
- $addLabel("dependencies")
# This workflow validates that pull requests do not contain changes to the license.
# This helps avoid unwanted license modifications.
- name: license-validation
description: Validate that licenses are not modified
always-run: true
if:
# Fail Reviewpad check on pull requests that modify any LICENSE;
- rule: $hasFilePattern("**/LICENSE*")
extra-actions:
- $fail("License files cannot be modified")