Skip to content

Ana06/automatic-pull-request-review

 
 

Repository files navigation

This project is a fork of https://github.com/AndrewMusgrave/automatic-pull-request-review which fixes DISMISS and provides an allow_duplicate option which allows to only approve once.

Automatic Pull Request Review

👍 Github action to automate pull requests

This action allows you to use any of the pull_request webhook event to automate pull request reviews. For example when a pull request is opened by dependabot, automatically approve it.

Usage

  1. Create a new workflow by adding .github/workflows/pull-request-automation.yml to your project.
  2. In the pull-request-automation.yml you have to decide which events you'll act on and the actors pull requests to automate.

For example:

To approve all pull requests pull requests from dependabot, you would add the following to the yml file:

name: Automatic pull request review
on: [pull_request]
jobs:
  automate-pullrequest-review:
    runs-on: ubuntu-latest
    steps:
      - name: Approve pull request
        if: github.actor == 'dependabot[bot]'
        uses: Ana06/[email protected]
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          event: APPROVE
          body: 'Thank you dependabot 🎊'
          allow_duplicate: false

Workflow options

These are the options recommended to be changed. For more detailed explanation of the workflow file, check out the GitHub documentation.

Setting Description Values
event The event to perform on the pull request review. APPROVE | COMMENT | DISMISS | REQUEST_CHANGES
body The content of the review body comment. Required when event is COMMENT or REQUEST_CHANGES. String
allow_duplicate The review is sent more than once. true by default. It is ignored for the DISMISS event. true or false
repo-token The personal access token. ${{ secrets.GITHUB_TOKEN }}

Build action

Creating a commit should build the action. You can also run the following commands:

yarn
yarn build

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%