My team <team-1>
is sharing a github repo with <team-2>
. The repo looks something like this (Simplified example):
infrastructure/
|
|-- .github/CODEOWNERS
|
|-- directory1/
|
|-- subdirectory1.1/
|
|-- subdirectory1.2/
|
|-- directory2/
|
|-- subdirectory2.1/
|
|-- subdirectory2.2/
|
|-- directory3/
|
|-- subdirectory3.1/
|
|-- subdirectory3.2/
<team-2>
is the CODEOWNER of every directory in the repo, and my team <team-1>
owns only subdirectory1.1
and subdirectory2.1
.
In otherwords the CODEOWNERS file looks something like this:
github/CODEOWNERS
* @mycompany/team2
/infrastructure/directory1/subdirectory1.1 @mycompany/team1
/infrastructure/directory2/subdirectory2.1 @mycompany/team1
Given the aforementioned, what I would like to do is exclude team2
from every folder that team1 owns, ideally without removing the wildcard in the codeowners file.
* @mycompany/team2
/infrastructure/directory1/subdirectory1.1 @mycompany/team1 AND EXCLUDE TEAM2
/infrastructure/directory2/subdirectory2.1 @mycompany/team1 AND EXCLUDE TEAM2
What is the best way to do that without rewriting the whole codeowners logic?