Automatically assign reviewers at random and notify them on Discord!
Note
To create a Webhook, you should be the admin👑 or have the Manage Webhooks permission.
- In your Discord server, go to Server Settings and click Integrations.
- Click Webhooks.
- If you haven't created any webhooks, a new webhook will be created automatically. If not, click New Webhook.
- Change the name and profile picture as you like. This action doesn't have a default name or profile picture for the webhook.

- Click Copy Webhook URL and save it for later. (Or you can come back here and copy it again!)
Warning
You can skip this step and add these values directly in the .yaml file,
but exposing Discord user IDs and the webhook URL is NEVER a good idea.
You need two secrets:
WEBHOOK_URLUSERNAMES
- On your GitHub repository page, go to Settings and click Secrets and variables > Actions.

- Under Repository secrets, click New Repository Secret.

- Name it
WEBHOOK_URLand paste your Discord Webhook URL. - Create another secret named
USERNAMES, and the secret should contain the usernames for reviewers.
The format should be:
githubusername1:discorduserid1
githubusername2:discorduserid2
githubusername3:discorduserid3
and so on. To find a Discord User ID, follow this official document.
Important
This action is not stable yet and upcoming minor versions may have breaking changes.
Specify the full version (e.g., JedBeom/random-reviewer-discord@v0.2.1) instead of using v0.
Create a file .github/workflows/random-reviewer.yaml and paste the following:
name: Random Reviewer Discord
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
- review_requested
branches:
- main
pull_request_review:
types:
- submitted
schedule:
- cron: 0 10 * * 6
workflow_dispatch:
permissions:
pull-requests: write
jobs:
assign-reviewer:
runs-on: ubuntu-latest
steps:
- name: Run random-reviewer-discord
uses: JedBeom/random-reviewer-discord@v0.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
usernames: ${{ secrets.USERNAMES }}
webhook_url: ${{ secrets.WEBHOOK_URL }}Important
Don't forget to add permissions! This action requires pull-requests: write.
Note
To copy the file with full options: see example.yml. For default values and descriptions, see action.yml.
Add(Stage) the file, commit it to a new branch, push it, and create a PR.
This action supports the following events:
pull_request(Webhook)opened: Assign the reviewer on random if no reviewers were assigned.reopened: Notify the requested reviewers if present. Otherwise, assign on random among the previous reviewers or the assignees.ready_for_review: (same asreopened)review_requested: Notify the requested reviewer(s). Requesting on the closed/draft PRs would not fire the alert by default.
pull_request_review(Webhook)submitted: Notify the author when the review was submitted.
schedule: Remind reviewers who were requested reviews but haven't done yet.workflow_dispatch: Do the same tasks asschedule. Share options(inputs) withschedule. See GitHub Rest Documentation to trigger the action manually.
Other event types would be ignored with an error.
You may want to exclude some users from the usernames. Add # in front of the line to exclude them.
For example, if user2 should be excluded,
user1:1111111111111111111
#user2:2222222222222222222
user3:3333333333333333333
adding # in front of user2's line makes the action ignore them. Remove # if you want to include them again.
You can customize the Discord message using the template_* inputs.
See action.yml for the list of templates and examples.
Each templates except template_schedule supports the following variables:
{mention}: Mention of the notification target. Mostly it is the reviewer(s). Fortemplate_review_submitted_*, this is the mention of the author.- e.g.
<@1111111111111111111>or<@1111111111111111111> <@2222222222222222222>
- e.g.
{prTitle}: The title of the pull request.- e.g.
Remove unused dependencies
- e.g.
{prNumber}: Number uniquely identifying the pull request within its repository.- e.g.
314
- e.g.
{prURL}: URL of the pull request.- e.g.
https://github.com/JedBeom/random-reviewer-discord/pull/9
- e.g.
Some templates support additional variables:
{sender}: A GitHub username of the user who requested the review.- supported templates:
template_review_requested_onetemplate_review_requested_plural
- e.g.
JedBeom
- supported templates:
{reviewer}: A GitHub username of the reviewer.- supported templates:
template_review_submitted_commentedtemplate_review_submitted_changes_requestedtemplate_review_submitted_approved
- supported templates: