Add an Ignore file to github CODEOWNER

353 views Asked by At

I have a simple repo that has branch protection / CODEOWNERs set to:

* @team

Is it possible to add a file / folder to CODEOWNER to make it be ignored?

Ive tried ! package.json and !package.json but both have made the CODEOWNERS file have an error.

1

There are 1 answers

0
Drazen Bjelovuk On

Just include it underneath with an empty owner:

# 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

https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file