GitHub Action with a GitHub Token

This guide describes the setup for Reviewpad GitHub Action with a GitHub Token.

Why?

By default a GitHub Action runs with an automatic token generated and provided by GitHub.

Although this generate token is enough to run most of Reviewpad functions, there are functions that need more permissions to run. An example is the function $team that requires access to the organizations' members.

All functions that require a GitHub Token to be provided are marked with the following message:

:warning: Requires a GitHub token :warning:

Therefore in order to setup Reviewpad GitHub Action with a GitHub Token, follow the following steps:

Step 1. Generate a GitHub token

In order to do that, please follow GitHub tutorial. Don't forget to save the token. We will use it in the next step.

Make sure that you give the following permissions when generating the token:

Step 2. Add the generated GitHub token to Actions Secrets

  1. Go to your GitHub project (the project where you want the Reviewpad Action to run)
  2. Select the tab Setting
  3. On the left select Actions under Secrets
  4. Click the button New Repository Secret
  5. Add the new secret and then click on Add secret
    • Name: GH_TOKEN
    • Value: THE_GENERATED_TOKEN_ON_STEP_1

Step 4. Configure the GitHub action

name: Reviewpad Action
on:
  pull_request

jobs:
  reviewpad-action:
    runs-on: ubuntu-latest
    steps:
      - name: Running reviewpad action
        uses: reviewpad/[email protected]
        with:
          token: ${{ secrets.GH_TOKEN }}

The source code of the GitHub Action can be found in the GitHub repository reviewpad/action.

Step 5. Add revy.yml to the root of the repository

You can skip this step if you already have the revy.yml file on your repository.

Add the configuration file revy.yml to the root of your repository.

This file follows a particular configuration language called Revy.

❗️

Terms and Conditions

By running this action you’re agreeing with Reviewpad’s Terms and Conditions.


Did this page help you?