All posts

Git / CODEOWNERS file

Posted On 03.03.2022

On Github, you can create a CODEOWNERS file in the .github/ or docs/ folder to specify which person or team is responsible for the code in a repository.

If a file or a folder has a code owner, their name will be displayed when someone views the file on Github. All the involved code owners can also be automatically suggested as a reviewer when you open new pull requests.

The syntax of the CODEOWNERS file is similar to the .gitignore file, but you need to specify the owner (an individual or a team) next to an entry:

*.js @frontend-team
 
*.test.js @huy
 
.github @sre-team
 
apps/app-01 @david
apps/app-02 @ben @david
 
ui/components/dropdown/* @maki
ui/components/forms @huy @maki

More details can be found in the official document on Github or Gitlab.