This commit is contained in:
Sasha Sidletsky 2021-07-16 20:04:18 +02:00 коммит произвёл GitHub
Родитель 83e925dac6
Коммит 3dac8c2e35
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -84,6 +84,12 @@ apps/ @octocat
# directory in the root of your repository and any of its
# subdirectories.
/docs/ @doctocat
# In this example, @octocat owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as its owners are left empty.
/apps/ @octocat
/apps/github
```
### Syntax exceptions
There are some syntax rules for gitignore files that do not work in CODEOWNERS files:
@ -91,6 +97,29 @@ There are some syntax rules for gitignore files that do not work in CODEOWNERS f
- Using `!` to negate a pattern
- Using `[ ]` to define a character range
## CODEOWNERS and branch protection
Repository owners can add branch protection rules to ensure that changed code is reviewed by the owners of the changed files. For more information, see "[About protected branches](/github/administering-a-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)."
### Example of a CODEOWNERS file
```
# In this example, any change inside the `/apps` directory
# will require approval from @doctocat.
/apps/ @doctocat
# In this example, any change inside the `/apps` directory
# will require approval from @doctocat or @octocat.
/apps/ @doctocat @octocat
# In this example, any change inside the `/apps` directory
# will require approval from a member of the @example-org/content team.
# If a member of @example-org/content opens a pull request
# with a change inside the `/apps` directory, their approval is implicit.
# The team is still added as a reviewer but not a required reviewer.
# Anyone can approve the changes.
/apps/ @example-org/content-team
```
## Further reading