Code Owners

Gitea maintains code owner files. It looks for it in the following locations in this order:

  • ./CODEOWNERS
  • ./docs/CODEOWNERS
  • ./.gitea/CODEOWNERS

And stops at the first found file.

File format: <regexp rule> <@user or @org/team> [@user or @org/team]...

Regexp specified in golang Regex format. Regexp can start with ! for negative rules - match all files except specified.

Example file:

  1. .*\\.go @user1 @user2 # This is comment
  2. # Comment too
  3. # You can assigning code owning for users or teams
  4. frontend/src/.*\\.js @org1/team1 @org1/team2 @user3
  5. # You can use negative pattern
  6. !frontend/src/.* @org1/team3 @user5
  7. # You can use power of go regexp
  8. docs/(aws|google|azure)/[^/]*\\.(md|txt) @user8 @org1/team4
  9. !/assets/.*\\.(bin|exe|msi) @user9

Escaping

You can escape characters #, (space) and \ with \, like:

  1. dir/with\#hashtag @user1
  2. path\ with\ space @user2
  3. path/with\\backslash @user3

Some character (.+*?()|[]{}^$\) should be escaped with \\ inside regexp, like:

  1. path/\\.with\\.dots
  2. path/with\\+plus