Skip to main content
Version: 3.10.0

Auto-merge

Requires GitHub token

Please note that this function requires the Reviewpad Action to be installed with a GitHub token

The ability to configure automatic pull requests merges can greatly unblock developers that typically wait for hours, or even days, to receive a LGTM review.

Since not every pull request needs the same review process, using the semantic features of Reviewpad, you can configure many scenarios where auto-merge seems natural.

Out of the box, Reviewpad supports a merge action which can be used in multiple scenarios.

Auto-merge based on file properties

api-version: reviewpad.com/v3.x

labels:
ship:
description: Ship mode
# color is the hexadecimal color code for the label, without the leading #.
color: 76dbbe

rules:
- name: changes-to-md-files
kind: patch
description: Patch only contains changes to files with extension .md
spec: '$hasFileExtensions([".md"])'

workflows:
- name: ship
description: Ship process - bypass the review and merge with rebase
if:
- rule: changes-to-md-files
then:
- '$addLabel("ship")'
- '$merge()'

Auto-merge small pull requests

api-version: reviewpad.com/v3.x

labels:
ship:
description: Ship mode
color: 76dbbe

rules:
- name: is-small-patch
kind: patch
description: Patch has less than 90 changes and 6 files
spec: '$size() < 90 && $fileCount() <= 5'

workflows:
- name: ship
description: Ship process - bypass the review and merge with rebase
if:
- rule: is-small-patch
then:
- '$addLabel("ship")'
- '$merge("rebase")'

Auto-merge non-critical pull requests

The hasAnnotation built-in can be used to configure powerful auto-merges. See a more in-depth example of the usage of hasAnnotation in the automated labelling section.

api-version: reviewpad.com/v3.x

labels:
ship:
description: Ship mode
color: 76dbbe

rules:
- name: not-critical-changes
kind: patch
description: Patch does not touch critical code
spec: '!$hasAnnotation("critical")'

workflows:
- name: ship
description: Ship process - bypass the review and merge with rebase
if:
- rule: not-critical-changes
then:
- '$addLabel("ship")'
- '$merge("rebase")'