Home > Back-end >  Does CODEOWNERS inherit owners
Does CODEOWNERS inherit owners

Time:08-18

Consider the following CODEOWNERS file:

*             @username1
/subfolder/   @username2

Now if a change is made to /subfolder/somefile.txt... Will only @username2 get added as a reviewer OR would both @username1 and @username2?

PS: Testing this would require me to create three accounts (mine to make the edit, username1 and username2 to test) - AND - this information should be publically available for future searchers. I couldn't find this example covered in the official docs.

Would like an example or a document reference to be sure or answer correctness.

CodePudding user response:

Only @username2 will be added as a reviewer. Since the order in which you place the patterns is important. It tries to take the last match.

In the docs they give an example of a CODEOWNERS file, and they try to explain with an example how inheritance works.

  • Related