Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is that possible that there are multiple codeowners files in a repository

Tags:

github

I have a question, is that possible that there are multiple codeowners files in a repository?

the structure of repo looks like this:

/web
/src
/test

I have created a CODEOWNERS file under root repo

/web
/src
/test
CODEOWNDERS

It works perfectly.

Is that possible to create multiple codeowners file under /web and /src

/web
  CODEOWNDERS ---> for web
/src
  CODEOWNDERS ---> for src
/test
CODEOWNDERS

under Codeowners for web, it will be defined for web team.

like image 822
user1938143 Avatar asked Sep 18 '25 11:09

user1938143


1 Answers

CODEOWNERS was introduced in Nov. 2019, and its documentation mentions only CODEOWNERS file per branch, not per folder.

To use a CODEOWNERS file, create a new file called CODEOWNERS in the root, docs/, or .github/ directory of the repository, in the branch where you'd like to add the code owners.

Each CODEOWNERS file assigns the code owners for a single branch in the repository.
Thus, you can assign different code owners for different branches, such as @octo-org/codeowners-team for a code base on the default branch and @octocat for a GitHub Pages site on the gh-pages branch.

like image 91
VonC Avatar answered Sep 21 '25 11:09

VonC