Skip to content

Aljullu/Request-Reviewer-For-Team-Action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Request-Reviewer-For-Team-Action

Node.js CI

About

At BriteCore we wanted to be able to assign a team to review a pr based on the author's team. Github doesn't particulary make getting team information easy to get to, so I assumed that other teams might have this need as well and built this action to help out.

Usage

Example Configuration

This belongs in .github/request-review-for-team.yml:

when:
  - author:
      # At least one of the following matches...
      nameIs:
        - Author1
        - Author2
      teamIs:
        - Team1
        - Team2
    assign:
      teams:
        - ReviewTeam1
        - ReviewTeam2
      individuals:
        - Reviewer1
        - Reviewer2
    # Ignore authors even if they belong to a specified team.
    ignore:
      nameIs:
        - Author1
        - Author2

  - author: 
      nameIs: 
        - acq688
    assign:
      individuals:
        - myles2007
  - author: 
      teamIs: 
        - solution-architecture
    assign:
      individuals:
        - acq688

Workflow Configuration

This belongs in .github/workflows/request-reviewer-for-team-action.yml

name: 'Request Reviewer For Team Action'
on: pull_request

jobs:
  add-reviews:
    runs-on: ubuntu-latest
    steps:
      - uses: acq688/request-reviewer-for-team-action@[RELEASE]
        with:
          config: ".github/request-review-for-team.yml"  # Or whatever you named your config...
          GITHUB_TOKEN: ${{ secrets.DEVOPS_BOT_ACCESS_TOKEN }}   # A PAT with the permission to write to the repo. See below for more information.

Potential Gotcha and Workaround

There seems to be a bug that the default GITHUB TOKEN doesn't have the correct permission to request a review from a team. To get around this I am using a machine user's personal access token instead of the default token.

Refer to this issue for more information: peter-evans/create-pull-request#155

TODO

  1. Planning on adding test coverage soon.

License

The project is licensed under MIT.

About

Assign reviews to people or teams based on the pr's author or author's team.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%