GitHub action to supercharge your pull request and issues workflows!

  • By Reviewpad
  • Last update: Dec 30, 2022
  • Comments: 14

Reviewpad-Background-Logo-Shorter@1 5x

Reviewpad GitHub Action

x-ray-badge CIDeploy

🔥 Latest Stable Version: v3.x (Faro Edition)

🤔 For questions, check out the discussions.

📃 For documentation, check out this document and the official documentation.

🙌 Join our community on discord!


This action runs the docker image reviewpad/action.

It reads and automates the pull request workflows specified in the reviewpad.yml configuration file.

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/v3.x

workflows:
  - name: label-pull-request-with-size
    if:
      - rule: $size() <= 50
        extra-actions:
          - $addLabel("small")
      - rule: $size() > 50 && $size() <= 150
        extra-actions:
          - $addLabel("medium")
      - rule: $size() > 150
        extra-actions:
          - $addLabel("large")

Specifies a workflow to automatically add a label based on the size of the pull request.

For more information on the release procedure, check the RELEASE.md document.

Inputs

  • event: The GitHub event context that trigger the action. Uses default ${{ toJSON(github) }}
  • file: The local location of the Reviewpad configuration file. Uses default ./reviewpad.yml. Ignored if file_url is set.
  • file_url (OPTIONAL): The remote location of the Reviewpad configuration file. If set, it will ignore the input file.
  • token: Uses default ${{ github.token }}

Usage

Basic

Add the following step to your GitHub Action job:

- name: Run reviewpad action
  uses: reviewpad/[email protected]

🔗 Remote configuration

You can run reviewpad action with a remote configuration by setting the input file_url:

- name: Run reviewpad action
  uses: reviewpad/[email protected]
  with:
    file_url: https://github.com/reviewpad/action/blob/main/templates/start.yml

🔑 GitHub token

By default this action uses the github-actions[bot] token.

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 merge feature, we recommend that you explicitly provide a PAT (Personal Access Token) to run this action:

- name: Run reviewpad action
  uses: reviewpad/[email protected]
  with:
    token: ${{ secrets.GH_TOKEN }}

Please follow this link to know more.

Download

action.zip

Comments(14)

  • 1

    Reviewpad action output with "missing variable INPUT_TOKEN"

    Describe the bug It can happen that when running reviewpad action the action fails with the message missing variable INPUT_TOKEN. Here's an example - https://github.com/reviewpad/reviewpad/runs/7852917856?check_suite_focus=true

    We need to understand why this is happening and how to solve it.

    INPUT_TOKEN is the toke provided by github when running the reviewpad action - https://github.com/reviewpad/action/blob/main/action.yml#L19

    To Reproduce This behavior is not predictable but we can find it in some places. Heres's one.

    Please not that this happened for an event from Reviewpad / reviewpad (pull_request_review).

    Expected behavior The action shouldn't fail.

    Screenshots image

  • 2

    Feature/dry run reviewpad on reviewpad.yml change

    Description

    This PR changes the action so that if the reviewpad.yml file has been changed by a pull request, it will run Reviewpad in dry run mode using the reviewpad.yml file from the pull request.

    Related Issues

    #10 reviewpad/reviewpad#158

  • 3

    Stale workflow not working

    Describe the bug The stale workflow doesn't seem to be working.

    To Reproduce https://github.com/reviewpad/reviewpad/actions/runs/3056965624/jobs/4931634253

    Expected behavior The stale workflow should be working and add the stale label if appropriate.

  • 4

    feat: dry run on reviewpad.yml change

    Description

    This pull request introduces the following changes in the behaviour of the action:

    • If the reviewpad.yml file has been changed by a pull request, it will run Reviewpad in dry run mode using the reviewpad.yml file from the head branch of the pull request.

    This pull request subsumes https://github.com/reviewpad/action/pull/12 and is co-authored by @zolamk !

    Related issue

    Closes #10

    Type of change

    Breaking change (fix or feature that would cause existing functionality to not work as expected)

    How was this tested?

    This feature requires extensive functional testing.

    Checklist

    • [x] I have performed a self-review of my code
    • [x] I have added tests that prove my fix is effective or that my feature works
    • [x] I have ran task check -f and have no issues
  • 5

    Reviewpad did not run in safe mode on change to reviewpad.yml file

    Describe the bug In the following pull request (https://github.com/reviewpad/reviewpad/pull/304) since the reviewpad.yml file was changed, we were suppose to run in the safe mode whereby we use the newly updated file and run it in dry run mode.

    However, I couldn't see any report in the pull request after its execution.

  • 6

    ReadMe Updated With Necessary Formatting

    The buttons have been brought below the heading tag and the unwanted line breaks have been removed from the ReadMe.

    Type of change

    Improvements (non-breaking change without functionality)

    Checklist

    • [x] I have performed a self-review of my code
    • [x] I have added tests that prove my fix is effective or that my feature works
    • [x] I have ran task check -f and have no issues

    Code review and merge strategy (ship/show/ask)

    • [x] Ship: this pull request can be automatically merged and does not require code review
  • 7

    feat: add exit status to reviewpad runners

    Description

    This pull request handles the exit status now returned by the reviewpad runners (only available after https://github.com/reviewpad/reviewpad/pull/219 is merged!).

    Related issue

    Closes #21

    Type of change

    New feature (non-breaking change which adds functionality)

    How was this tested?

    Ran task build.

    Checklist

    • [x] I have performed a self-review of my code
    • [ ] I have ran task check -f and have no issues

    Code review and merge strategy (ship/show/ask)

    [x] Ask: this pull request requires a code review before merge

  • 8

    feat/input_configuration_file_url

    feat/input_configuration_file_url

    Description

    Feat adds config by url parameter

    Related issue

    Closes issue #13

    Type of change

    Breaking change (fix or feature that would cause existing functionality to not work as expected)

    How was this tested?

    Ran task test command. Test by run it manually

    Checklist

    • [x] I have performed a self-review of my code
    • [x] I have ran task check -f and have no issues
  • 9

    chore: run cideploy only on production environment

    Description

    We have created a production environment on github.

    The idea of this pr is to run cideploy action only on production.

    Related issue

    none

    Type of change

    Improvements (non-breaking change without functionality)

    How was this tested?

    Requires merge in order to be tested.

    Checklist

    • [x] I have performed a self-review of my code
    • [x] I have added tests that prove my fix is effective or that my feature works
    • [x] I have ran task check -f and have no issues
  • 10

    Read reviewpad.yml from base branch

    This pull request makes the following changes:

    • Error handling with accessing information about the pull request
    • Read reviewpad.yml from the base branch instead of the head branch
    • Fail with exit code 1 on more instances.

    Closes #7.

    View on Reviewpad

  • 11

    Some suggestions

    (1)

    Unhandled error

    //....
    buf := new(bytes.Buffer)
    buf.ReadFrom(ioReader)  // !
    

    (2)

    Isn't this "return" redundant?

    func main() {
    
        //..........
        if err != nil {
            if file.IgnoreErrors {
                log.Print(err.Error())
            } else {
                log.Fatal(err.Error())
            }
            return   // ???
        }
    }
    
  • 12

    Send mixpanel testing events to dev board

    Is your feature request related to a problem? Please describe. Right now, the action testing events (events that are sent in a development environment) are being sent to the prod board which pollutes real data.

    Describe the solution you'd like The testing events should be sent to the dev board and not the prod board.

  • 13

    [NEEDS TESTING] chore: update the Load func and reviewpad version

    NOT TESTED YET

    In order to be tested, it is needed the ability to send Mixpanel events in a development environment.

    Description

    As a consequence of https://github.com/reviewpad/reviewpad/pull/573, the Load function needs to be updated wherever it is mentioned since its signature was updated to also include the collector. This PR can only be merged when https://github.com/reviewpad/reviewpad/pull/573 has been merged. And after the needed merge, the reviewpad version needs to be updated in this PR since it is currently pointing to the branch of the PR that introduces the changes to the Load function signature.

    Type of change

    Improvements (non-breaking change without functionality)

    How was this tested?

    NOT TESTED YET In order to be tested, it is needed the ability to send Mixpanel events in a development environment.

    Checklist

    • [x] I have performed a self-review of my code
    • [x] I have run task check -f and have no issues

    Code review and merge strategy (ship/show/ask)

    • [x] Ask: this pull request requires a code review before the merge
  • 14

    file_url is missing from inputs on action.yml

    Describe the bug We have introduced the new action input file_url on one of the v3.x. However, when the release v3.x has performed the input file_url did not existed. This cases the github action to throw a warning message when execution (see screenshot for details)

    To Reproduce You can see a reproduction here https://github.com/padawancat/paddy/runs/8111040913?check_suite_focus=true

    Expected behavior No warning should be thrown.

    Notes This issue will be fixed when a new version of reviewpad action (e.g. v4.x) is performed.

    Screenshots image

    This is a screenshot of https://github.com/padawancat/paddy/runs/8111040913?check_suite_focus=true.