From 5df1f7e957d7e7e1729872e08f6579afa27e2a49 Mon Sep 17 00:00:00 2001 From: chrisgarber <30669660+chrisgarber@users.noreply.github.com> Date: Tue, 4 Jan 2022 13:26:34 -0500 Subject: [PATCH 1/3] Note case-sensitivity in CODEOWNERS file --- .../customizing-your-repository/about-code-owners.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md b/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md index d5d45325ef68..4d0eac331499 100644 --- a/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md +++ b/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md @@ -50,6 +50,8 @@ To reduce the size of your CODEOWNERS file, consider using wildcard patterns to 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 `user@example.com`. If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews. + +CODEOWNERS paths are case sensitive, because GitHub uses a case sensitive file system. Since CODEOWNERS are evaluated by GitHub, even systems (e.g. MacOS) that are case insensitive should ensure that paths and files are cased correctly in the CODEOWNERS file. ### Example of a CODEOWNERS file ``` # This is a comment. From e31b8241adbbd59fddccc9935afe1b6dd13f733d Mon Sep 17 00:00:00 2001 From: chrisgarber <30669660+chrisgarber@users.noreply.github.com> Date: Tue, 4 Jan 2022 13:29:41 -0500 Subject: [PATCH 2/3] Remove duplicate example sections --- .../about-code-owners.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md b/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md index 4d0eac331499..1afe82c79d96 100644 --- a/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md +++ b/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md @@ -99,6 +99,10 @@ apps/ @octocat # subdirectories. /docs/ @doctocat +# In this example, any change inside the `/scripts` directory +# will require approval from @doctocat or @octocat. +/scripts/ @doctocat @octocat + # 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. @@ -114,21 +118,6 @@ There are some syntax rules for gitignore files that do not work in CODEOWNERS f ## 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. -/apps/ @example-org/content-team -``` - ## Further reading From d8fff8267ab6ffe597cd2795f4a6a48ecc0c9fd4 Mon Sep 17 00:00:00 2001 From: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Date: Tue, 1 Feb 2022 10:11:39 -0800 Subject: [PATCH 3/3] Use reusable for GitHub name --- .../customizing-your-repository/about-code-owners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md b/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md index 1afe82c79d96..d6ac9ce97eb0 100644 --- a/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md +++ b/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners.md @@ -51,7 +51,7 @@ A CODEOWNERS file uses a pattern that follows most of the same rules used in [gi If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews. -CODEOWNERS paths are case sensitive, because GitHub uses a case sensitive file system. Since CODEOWNERS are evaluated by GitHub, even systems (e.g. MacOS) that are case insensitive should ensure that paths and files are cased correctly in the CODEOWNERS file. +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. ### Example of a CODEOWNERS file ``` # This is a comment.