Commands
Reviewpad commands introduce the ability to trigger Reviewpad actions through a command-like instruction using pull request comments.
This is particularly useful when you want to trigger actions on a pull request that are not specified in the Reviewpad configuration file.
A command is a comment that follows the following format:
/reviewpad [ACTION] [ACTION_ARGUMENTS]
Where ACTION is the action to be triggered and ACTION_ARGUMENTS are the arguments to be passed to the action.
Available commands
- /reviewpad assign-reviewers - Assign reviewers to a pull request.
- /reviewpad assign-random-reviewer - Assign a random reviewer to a pull request.
- /reviewpad dry-run - Run Reviewpad in dry-run mode and adds a comment with the actions that would be triggered.
- /reviewpad run - Trigger a Reviewpad run.
assign-reviewers
The assign-reviewers
command triggers the $assignReviewer
action.
This command assigns a defined amount of reviewers to the pull request from the provided list of reviewers.
Arguments:
Arguments | Description |
---|---|
comma_separated_list_of_reviewers | List of GitHub logins to select from. |
Flags:
Flags | Description |
---|---|
-t , --total-reviewers | The total number of reviewers to assign to. By default, it assigns to all reviewers. |
-p , --review-policy | The policy followed for reviewer assignment. By default, the policy is reviewpad . |
Syntax:
/reviewpad assign-reviewers <comma_separated_list_of_reviewers> [--total-reviewers|-t] <total_required_reviewers> [--review-policy|-p] <review_policy>
Examples:
/reviewpad assign-reviewers john,jane
/reviewpad assign-reviewers john,jane --total-reviewers 1 --review-policy random
/reviewpad assign-reviewers jane,john -t 1 -p random
assign-random-reviewer
The assign-random-reviewer
command triggers the $assignRandomReviewer
action.
This command assigns a random user of the GitHub organization as the reviewer.
Arguments:
none
Syntax:
/reviewpad assign-random-reviewer
Examples:
/reviewpad assign-random-reviewer
dry-run
The dry-run
command runs reviewpad in dry-run mode on the pull request where the command is invoked.
The outcome of the dry-run is added as a pull request comment.
The reviewpad configuration used is the one from the pull request base branch or the head branch if the pull request updates the reviewpad configuration.
Arguments:
none
Syntax:
/reviewpad dry-run
Examples:
/reviewpad dry-run
run
The run
command triggers a reviewpad run.
The reviewpad configuration used is the one from the pull request base branch or the head branch if the pull request updates the reviewpad configuration.
Arguments:
none
Syntax:
/reviewpad run
Examples:
/reviewpad run