docs
docs copied to clipboard
CODEOWNERS file syntax documentation does not make it explicitly clear that a pattern can only be used once
[maintainer edit] This issue is reserved for the MLH Fellowship program.
Code of Conduct
- [X] I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
What changes are you suggesting?
The existing documentation for file syntax does not make it explicitly clear that a pattern can only be specified once, and that if >1 instance of a pattern is present, the last instance will take precedence.
For example the following example would only request review from @doctocat, @octocat would not be included in the reviewers.
apps/ @octocat
apps/ @doctocat
I would propose that a line be added to the CODEOWNERS syntax section indicating that a repeated pattern is not supported.
Additional information
Additionally, I believe an issue should be raised internally against the validation of codeowners files - the above example will be marked as valid by the CODEOWNERS validation, and will not provide any indication to the end user that only the last instance of the pattern will be used.
Content plan
Found here
@ReidWeb Thanks so much for opening an issue! I'll triage this for the team to review :eyes:
Thanks @ReidWeb! We can definitely mention that if you want to list two code owners for the same pattern, they should be on the same line, because using multiple lines will fall prey to the "last matching pattern takes the most precedence" rule. 👍🏻 You or anyone else is welcome to open a PR for that!
I would like to work on this issue!
@nawed2611 You or anyone else is welcome to work on this issue! 💖