Reviewpad GitHub Action
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 iffile_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.
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=trueWe 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#L19To 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
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 thereviewpad.yml
file from the pull request.Related Issues
#10 reviewpad/reviewpad#158
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.
feat: dry run on reviewpad.yml change
Description
This pull request introduces the following changes in the behaviour of the action:
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
task check -f
and have no issuesReviewpad 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.
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
task check -f
and have no issuesCode review and merge strategy (ship/show/ask)
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
task check -f
and have no issuesCode review and merge strategy (ship/show/ask)
[x] Ask: this pull request requires a code review before merge
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 manuallyChecklist
task check -f
and have no issueschore: 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
task check -f
and have no issuesRead reviewpad.yml from base branch
This pull request makes the following changes:
Closes #7.
View on Reviewpad
Some suggestions
(1)
Unhandled error
(2)
Isn't this "return" redundant?
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.
[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 theLoad
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
task check -f
and have no issuesCode review and merge strategy (ship/show/ask)
file_url is missing from inputs on action.yml
Describe the bug We have introduced the new action input
file_url
on one of thev3.x
. However, when the releasev3.x
has performed the inputfile_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
This is a screenshot of https://github.com/padawancat/paddy/runs/8111040913?check_suite_focus=true.