Configure CODEOWNERS for the Github Organization

1.3k Views Asked by At

There's a concept of the community health files but I don't see CODEOWNERS file among the list. Is there a mechanism to setup CODEOWNERS for (all repositories in the) Github Organisation?

I tried reading the docs but couldn't find the relevant info, hence seeking help from the community.

1

There are 1 best solutions below

2
VonC On

The "About code owners" page does mention that you can define code owners in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.

When the code owner is a team, that team must be visible and it must have write permissions, even if all the individual members of the team already have write permissions directly, through organization membership, or through another team membership.

CODEOWNERS file location

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.