This site runs best with JavaScript enabled.Auto-Assign Pull Requests on GitHub

Auto-Assign Pull Requests on GitHub

March 21, 2020


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 an email or two per month to share things I'm excited about. I'd be delighted if you signed up.



Help others learn to code