A GitHub Action that can perform a Pull Request review from GitHub Actions. The primary purpose for this action is to provide automation in demos where we need an external user to perform a review to satisfy our branch protections rules.
pr_number
: The Pull Request number to apply the review tooutcome
: The review outcome, one ofapprove
,comment
orrequest_changes
. Notecomment
andrequest_changes
require you to also add acomment
valuerepository
: Optional fully qualified name of the repository that contains the Pull Request, defaults to${{ github.repository }}
from the workflowcomment
: Optional (although dependent on theoutcome
value) for the main comment/body for the reviewtoken
: Optional GitHub token that is used to access the API for applying the review. The user associated with the token is the reviewer
Get a temporary token for a GitHub Application and use that to apply a PR review as the application;
- name: Get temporary token for octodemobot application
id: temp_token
uses: peter-murray/workflow-application-token-action@v1.3.0
with:
application_id: ${{ secrets.OCTODEMOBOT_APPLICATION_ID_REPO_AUTOMATION }}
application_private_key: ${{ secrets.OCTODEMOBOT_APPLICATION_KEY_REPO_AUTOMATION }}
- name: Apply PR Code Review
uses: octodemo/pull-request-review-action@main
with:
pr_number: 1
outcome: approve
comment: I approve!
token: ${{ steps.temp_token.outputs.token }}