Skip to content

Commit c7bcb41

Browse files
authored
Merge pull request #13708 from chrisgarber/main
Note case-sensitivity of CODEOWERS in CODEOWNERS syntax docs
2 parents 57579c0 + f327a07 commit c7bcb41

File tree

1 file changed

+6
-15
lines changed
  • content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository

1 file changed

+6
-15
lines changed

content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ To reduce the size of your CODEOWNERS file, consider using wildcard patterns to
5050
A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files, with [some exceptions](#syntax-exceptions). The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. Users must have `read` access to the repository and teams must have explicit `write` access, even if the team's members already have access. You can also refer to a user by an email address that has been added to their account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}, for example `[email protected]`.
5151

5252
If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews.
53+
54+
CODEOWNERS paths are case sensitive, because {% data variables.product.prodname_dotcom %} uses a case sensitive file system. Since CODEOWNERS are evaluated by {% data variables.product.prodname_dotcom %}, even systems that are case insensitive (for example, macOS) must use paths and files that are cased correctly in the CODEOWNERS file.
5355
### Example of a CODEOWNERS file
5456
```
5557
# This is a comment.
@@ -97,6 +99,10 @@ apps/ @octocat
9799
# subdirectories.
98100
/docs/ @doctocat
99101
102+
# In this example, any change inside the `/scripts` directory
103+
# will require approval from @doctocat or @octocat.
104+
/scripts/ @doctocat @octocat
105+
100106
# In this example, @octocat owns any file in the `/apps`
101107
# directory in the root of your repository except for the `/apps/github`
102108
# subdirectory, as its owners are left empty.
@@ -112,21 +118,6 @@ There are some syntax rules for gitignore files that do not work in CODEOWNERS f
112118
## CODEOWNERS and branch protection
113119
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)."
114120

115-
### Example of a CODEOWNERS file
116-
```
117-
# In this example, any change inside the `/apps` directory
118-
# will require approval from @doctocat.
119-
/apps/ @doctocat
120-
121-
# In this example, any change inside the `/apps` directory
122-
# will require approval from @doctocat or @octocat.
123-
/apps/ @doctocat @octocat
124-
125-
# In this example, any change inside the `/apps` directory
126-
# will require approval from a member of the @example-org/content team.
127-
/apps/ @example-org/content-team
128-
```
129-
130121

131122
## Further reading
132123

0 commit comments

Comments
 (0)