This site runs best with JavaScript enabled.

Auto-Assign Pull Requests on GitHub

March 21, 2020

––– views

Back when I was working at Echobind, we used a Slack + GitHub integration to notify you of PRs you needed to review. I loved it! As soon as a PR was assigned to me, I would get a ding on Slack. It worked really well.

Since we worked on small teams, the PR reviewers were always the same 1-2 devs. I thought,

Wouldn't it be great if we could auto-assign them?

Turns out you can! Here's how:

  1. Create a file called CODEOWNERS (no extension)
  2. Place it at the root or in the .github directory
  3. Add the following code to your file:
    # Make @lukeskywalker @yoda reviewers for every file
    * @lukeskywalker @yoda

BOOM! And the cool part, you won't be assigned your own pull requests (I don't think you can be?)!

Note: you can get fancy and set up code owners for specific directories, extensions, etc. Read the docs.

If you prefer to learn by watching, you can find this on egghead.

Discuss on TwitterEdit post on GitHub

Share article

Join the Newsletter

I send a couple emails per month related to programming and learning. I also share goodies and deals here.

Help others learn to code