summaryrefslogtreecommitdiffstats
path: root/docs/content/doc/usage
diff options
context:
space:
mode:
authorVladimir Buyanov <81759784+cl-bvl@users.noreply.github.com>2023-06-08 11:56:05 +0300
committerGitHub <noreply@github.com>2023-06-08 16:56:05 +0800
commit3bdd48016f659c440d6e8bb57386fab7ad7b357b (patch)
tree7cf65016a18ce0e3d0e96e29838d40008f4306fe /docs/content/doc/usage
parentb5a2bb9ab347fb5aaa6c6ca95dfd1b31751f1fba (diff)
downloadgitea-3bdd48016f659c440d6e8bb57386fab7ad7b357b.tar.gz
gitea-3bdd48016f659c440d6e8bb57386fab7ad7b357b.zip
Add codeowners feature (#24910)
Hello. This PR adds a github like configuration for the CODEOWNERS file. Resolves: #10161
Diffstat (limited to 'docs/content/doc/usage')
-rw-r--r--docs/content/doc/usage/code-owners.en-us.md65
1 files changed, 65 insertions, 0 deletions
diff --git a/docs/content/doc/usage/code-owners.en-us.md b/docs/content/doc/usage/code-owners.en-us.md
new file mode 100644
index 0000000000..94f81eeae1
--- /dev/null
+++ b/docs/content/doc/usage/code-owners.en-us.md
@@ -0,0 +1,65 @@
+---
+date: "2023-05-24T16:00:00+00:00"
+title: "Code Owners"
+slug: "code-owners"
+weight: 30
+toc: false
+draft: false
+aliases:
+ - /en-us/code-owners
+menu:
+ sidebar:
+ parent: "usage"
+ name: "Code Owners"
+ weight: 30
+ identifier: "code-owners"
+---
+
+# 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:
+
+```
+.*\\.go @user1 @user2 # This is comment
+
+# Comment too
+# You can assigning code owning for users or teams
+frontend/src/.*\\.js @org1/team1 @org1/team2 @user3
+
+# You can use negative pattern
+!frontend/src/.* @org1/team3 @user5
+
+# You can use power of go regexp
+docs/(aws|google|azure)/[^/]*\\.(md|txt) @user8 @org1/team4
+!/assets/.*\\.(bin|exe|msi) @user9
+```
+
+### Escaping
+
+You can escape characters `#`, ` ` (space) and `\` with `\`, like:
+
+```
+dir/with\#hashtag @user1
+path\ with\ space @user2
+path/with\\backslash @user3
+```
+
+Some character (`.+*?()|[]{}^$\`) should be escaped with `\\` inside regexp, like:
+
+```
+path/\\.with\\.dots
+path/with\\+plus
+```