• Stars
    star
    234
  • Rank 171,630 (Top 4 %)
  • Language
    TypeScript
  • License
    ISC License
  • Created over 6 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ€– A Probot app that adds reviewers to pull requests when pull requests are opened.

Probot: Auto Assign

A GitHub App built with Probot that adds reviewers/assignees to pull requests when pull requests are opened.

screenshot

How it works

  • When the pull request is opened, automatically add reviewers/assignees to the pull request.
  • If the number of reviewers is specified, randomly add reviewers/assignees to the pull request.
  • If reviewers/assignees are separated into groups in the config file, randomly select the number of reviewers from each group.
  • If the title of the pull request contains a specific keyword, do not add reviewers/assignees to the pull request.

Usage

  1. Install the app.
  2. Create .github/auto_assign.yml in your repository with the following.

Single Reviewers List

Add reviewers/assignees to the pull request based on single reviewers list.

# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
  - reviewerA
  - reviewerB
  - reviewerC

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0

# A list of assignees, overrides reviewers if set
# assignees:
#   - assigneeA

# A number of assignees to add to the pull request
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
# numberOfAssignees: 2

# A list of keywords to be skipped the process that add reviewers if pull requests include it
# skipKeywords:
#   - wip

# A list of users to be skipped by both the add reviewers and add assignees processes
# skipUsers:
#   - dependabot[bot]

Add Github Team to Single Reviewers List

Add Github team to the pull request based on single reviewers list using the org/team_slug or /team_slug syntax.

# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A list of team reviewers to be added to pull requests (GitHub team slug)
reviewers:
  - org/teamReviewerA
  - org/teamReviewerB
  - /teamReviewerC

# Number of reviewers has no impact on Github teams
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0

# A list of assignees, overrides reviewers if set
# assignees:
#   - assigneeA

# A number of assignees to add to the pull request
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
# numberOfAssignees: 2

# A list of keywords to be skipped the process that add reviewers if pull requests include it
# skipKeywords:
#   - wip

Note: Number of reviewers has currently no impact on Github teams and all teams will be added as reviewers.

Note: This feature is not enabled in the hosted app below.
https://github.com/apps/auto-assign
To enable the team assignment, you need to host your own app and change the permission below that the app can read the organization's team.

  • Repository permissions
    • Administration - Read-Only
  • Organization permissions
    • Members - Read-Only

Multiple Reviewers List

Add reviewers/assignees to the pull request based on multiple reviewers list.

If you and peers work at the separate office or they work at the separate team by roles like frontend and backend, you might be good to use adding reviewers from each group.

# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 1

# A number of assignees to add to the pull request
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
# numberOfAssignees: 2

# Set to true to add reviewers from different groups to pull requests
useReviewGroups: true

# A list of reviewers, split into different groups, to be added to pull requests (GitHub user name)
reviewGroups:
  groupA:
    - reviewerA
    - reviewerB
    - reviewerC
  groupB:
    - reviewerD
    - reviewerE
    - reviewerF

# Set to true to add assignees from different groups to pull requests
useAssigneeGroups: false

# A list of assignees, split into different froups, to be added to pull requests (GitHub user name)
# assigneeGroups:
#   groupA:
#     - assigneeA
#     - assigneeB
#     - assigneeC
#   groupB:
#     - assigneeD
#     - assigneeE
#     - assigneeF

# A list of keywords to be skipped the process that add reviewers if pull requests include it
# skipKeywords:
#   - wip

Assign Author as Assignee

Add the PR creator as assignee to the pull request.

# Set to author to set pr creator as assignee
addAssignees: author

Advantage

Use Auto Assign in combination with code owners

If you want to add the same reviewers every time the pull request is opened, you can use code owners. Also, if you want to add randomly reviewers, you can use this app together.

About code owners - GitHub Help

Development

# Install dependencies
npm install

# Run typescript
npm run build

# Run the bot
npm start

# Test before submitting a PR
npm test

See Contributing for more information about making improvements to auto-assign.

Deploy

Glitch

Remix on Glitch

  1. Configure a new app on Github.
    • For the Homepage URL, use your repository url or your homepage url: https://random-word.glitch.me/probot.
    • For the Webhook URL, use this URL (again, updating the domain to match yours): https://random-word.glitch.me/. Notice that we left off the /probot.
    • For the Webhook Secret, just use "development". Input the same value in .env file.
    • On the Permissions & webhooks tab, add read/write permissions, read metadata and read single file (.github/auto_assign.yml) for pull requests.
    • On the Permissions & webhooks tab, subscribe to Pull request events.
    • Save your changes.
    • Download the private key.
  2. Click the Install tab, and install your app into one of your repositories.
  3. Click the New File button (at left) and type .data/private-key.pem. Then click Add File. Copy the contents of the private key you downloaded after creating the app, paste it into the new file in Glitch.
  4. Edit the .env file (at left) with your app credentials.
    • Check the example as below.
  5. Wait for app to load. A green Live label should show up next to the Show button when it's finished loading.
# The ID of your GitHub App; You can find this in the About section of your Github app
APP_ID=

# The Webhook Secret; This is generated by you and then inputted in the settings of your Github app.
WEBHOOK_SECRET=development

# The path to a private key file; This is set by you and then set the contents of the private key you downloaded after creating the app.
PRIVATE_KEY_PATH=.data/private-key.pem

GitHub Actions

If you want to use the auto-assign app using GitHub Actions, refer to the following link. Also, because of providing the GitHub action for a new version (GitHub Actions v2; YAML format), the previous version (GitHub Actions v1; HCL format) is deprecated.

kentaro-m/auto-assign-action: An action which adds reviewers to the pull request when the pull request is opened.

Contributing

If you have suggestions for how auto-assign could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

ISC Β© 2018 Kentaro Matsushita

More Repositories

1

auto-assign-action

An action which adds reviewers to the pull request when the pull request is opened.
TypeScript
245
star
2

md2confl

πŸ›  md2confl is a CLI tool to convert the markdown text to confluence wiki format.
Go
77
star
3

task-completed-checker-action

β˜‘οΈ A GitHub action that checks if all tasks are completed in the pull requests.
TypeScript
59
star
4

catchy-image

🎨 A Node.js module for dynamically generating social cards (open graph images).
JavaScript
46
star
5

blackfriday-confluence

πŸ›  Blackfriday-Confluence is confluence wiki renderer for the Blackfriday v2 markdown processor.
Go
21
star
6

lambda-pr-notify-bot

πŸ€– A bot that improve pull request workflow on GitHub.
JavaScript
19
star
7

add-an-issue-reference-action

:octocat: A GitHub Action for adding a related issue reference to a pull request.
TypeScript
18
star
8

gh-lspr

gh-lspr is GitHub CLI extension to help you to check pull requests to which you need to respond.
Shell
18
star
9

portfolio

😸 A my portfolio site that fetch data and display from various services such as GitHub, Qiita, SpeakerDeck.
CSS
12
star
10

portfolio-gatsby

😎 kentarom's portfolio site
SCSS
9
star
11

coverage-markers

πŸ“¦ Atom package to display JavaScript test coverage on gutter of editor.
JavaScript
6
star
12

issue-creator

πŸš„ A Slack slash command for creating quickly a new issue on GitHub.
JavaScript
6
star
13

task-complete-checker

βœ… A Probot app that checks if all tasks are completed in the pull requests.
JavaScript
5
star
14

honyaku-flag

🚩 A Slack app that translates a message when an emoji reaction added to the message.
TypeScript
5
star
15

mkissue

🎫 Create GitHub issues from importing CSV file.
TypeScript
4
star
16

qr-code-commenter-action

πŸ“· A GitHub Action that posts a QR code to a pull request comment.
TypeScript
4
star
17

japanese-tech-company-blog-updates

πŸ“Ί Deliver the latest tech news on Japanese technology companies.
Vue
4
star
18

pr-notify-bot

πŸ€– A slackbot that reminds reviewers to review their pull requests.
JavaScript
3
star
19

zenhub-time-tracker

⌚ Keep track of time to move an issue between pipelines and notify the time into Slack.
JavaScript
3
star
20

renovate-config

A config preset for Renovate used by @kentaro-m
3
star
21

waiting-for-review-labeler

⏰ An action for adding label to a pull request after it being opened or ready for review for more than certain hours.
TypeScript
2
star
22

resume

πŸ’» My resume
2
star
23

spider

πŸ‘· WIP A crawler for collecting tech news
Go
2
star
24

react-login-form-sample

πŸ”’ βš›οΈ A login form example with React Hooks
TypeScript
2
star
25

learn-something-new

πŸ’ͺ Knowledge is power.
TypeScript
2
star
26

homebrew-md2confl

Ruby
1
star
27

rust-learning

Rust
1
star
28

lighthouse-keeper

TypeScript
1
star
29

book-box

πŸ“šUpdate a pinned gist to contain the status of reading books from Google Books.
TypeScript
1
star
30

dotfiles

Vim Script
1
star
31

kentaro-m

1
star
32

blog

TypeScript
1
star
33

b64

πŸ› Base64 Encode/Decode Tool
JavaScript
1
star
34

shuf

🎲 Write a random permutation of the input lines to standard output.
TypeScript
1
star
35

tic-tac-toe

JavaScript
1
star
36

tic-tac-toe-with-typescript

Tic Tac Toe with TypeScript
TypeScript
1
star
37

waiting-for-review-labeler-demo

🎑 A sandbox to run the waiting-for-review-labeler
1
star
38

clean-architecture-todo-example

🚧 An implementation example of the Todo app using Clean Architecture.
TypeScript
1
star