Reviewpad GitHub Action
Current Stable Version: v1.x Series
This action runs the docker image reviewpad/action.
The docker image is automatically pushed to Docker Hub on every commit to the main branch.
It reads and automates the pull request workflows specified in the reviewpad.yml
file at the root of your GitHub repository.
These workflows can be used to automatically label, assign reviewers, comment, merge and close pull requests.
For example, the following reviewpad.yml
file:
api-version: reviewpad.com/v1.x
rules:
isSmall:
kind: patch
description: small pull request
spec: $size() <= 50
isMedium:
kind: patch
description: medium-sized pull request
spec: $size() > 50 && $size() <= 150
isLarge:
kind: patch
description: large-sized pull request
spec: $size() > 150
workflows:
- name: label-pull-request-with-size
description: Label pull request with size
if:
- rule: isSmall
extra-actions:
- $addLabel("small")
- rule: isMedium
extra-actions:
- $addLabel("medium")
- rule: isLarge
extra-actions:
- $addLabel("large")
Specifies a workflow to automatically add a label based on the size of the pull request.
For more information, check out the official documentation.
- repository: Uses default
${{ github.repository }}
- prnumber: Uses default
${{ github.event.pull_request.number }}
- token: Uses default
${{ github.token }}
Outputs
None.
Usage examples
This action should only be used on pull_request
related events.
Add the following step to a GitHub Action job:
- name: Run reviewpad action
uses: reviewpad/action@v1.x
By default this action uses the github-actions[bot]
PAT.
As described in the official GitHub documentation:
When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN will not create a new workflow run.
If you want to use more advanced features such as the auto-merge feature, we recommend that you explicitly pass a PAT to run this action:
- name: Run reviewpad action
uses: reviewpad/action@v1.x
with:
token: ${{ secrets.GH_TOKEN }}
Please follow this link to know more.