Skip to content

A GitHub Action that auto-requests reviews on pull requests based on changed files.

License

Notifications You must be signed in to change notification settings

UcheSylvester/pr-smartrr

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Pr Smartrr


This GitHub Action automatically requests reviews on pull requests based on changed files.

It does this by checking the teammates with commits on those changed files and adding them as reviewers to pull requests. This means you do not need to manually provide a list of reviewers for this action.

Inputs

github-token

Required The GitHub token to use for authentication. Typically, this should be set to ${{ secrets.GITHUB_TOKEN }}.

max-reviewers

Optional The maximum number of reviewers to be added to the pull request. Defaults to 2.

Usage

  1. Create a Workflow YAML File: In your repository, create or edit a workflow YAML file (e.g., .github/workflows/main.yml).

  2. Define the Workflow:

name: main

on:
  pull_request:
    types: [opened]

defaults:
  run:
    shell: 'bash'

jobs:
  request-reviews:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          # Note: this is required for the action to work
          fetch-depth: 0

      - name: Auto PR review requests
        uses: UcheSylvester/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          max-reviewers: 2

Run Locally

To run this action locally, you need to have Node.js installed on your machine.

  1. Clone this repository:
git clone
  1. Install dependencies:
yarn
  1. Build the typescript:
yarn build
  1. Run the tests:
yarn test
  1. Run the local action with nektos/act:
act -j pr-labelr -s GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}

Contributing

We welcome contributions from the community to make Pr Smartrr even better. Whether it's bug fixes, new features, or improvements to documentation, your input is valuable. To contribute, follow these steps:

  1. Create an issue describing the feature/bug you want to work on.
  2. Fork the repository on GitHub.
  3. Create a new branch for your changes.
  4. Make your changes and commit them with descriptive messages.
  5. Submit a pull request to the main repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Get In Touch

Email | Follow on Twitter | Connect on LinkedIn | Report an Issue