CODEOWNERS Generator
Route repository changes to the right reviewers
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Each nonempty line must contain a pattern and at least one owner.
Place the file in .github/, the repository root, or docs/. The last matching rule wins.
Rate this tool:
Related tools
Other tools you may find usefulCODEOWNERS file generator for GitHub
The CODEOWNERS generator creates rules that assign users or teams to repository paths. When a pull request changes a matching file, GitHub can automatically request a review from the right people.
Enter one rule per line: a pattern followed by at least one owner. The tool preserves order, validates user and team formats, rejects constructs unsupported by CODEOWNERS, and can add explanatory comments. The webp.pl server processes the form data but does not send it to GitHub.
How to generate ownership rules
- Select the Frontend, Backend, or Monorepo preset, or enter custom patterns.
- After a pattern, add an
@user, an@organization/team, or an email address associated with an account. - Choose a default owner. The generator adds a
*rule unless the input already contains one. - Place general rules first and specific rules later because the last matching rule wins.
- Copy the output into a file named exactly
CODEOWNERSand commit it to the repository.
Ownership rules should be reviewed when the CI process changes. Create automated test configuration with the GitHub Actions generator, and organize ignored files with the .gitignore generator.
CODEOWNERS syntax and matching order
Patterns, owners, and examples
| Rule | Meaning |
|---|---|
* @maintainers | Default ownership for files without a later, more specific rule |
*.js @frontend-team | JavaScript files throughout the repository |
/docs/ @docs-team | Documentation in the root-level directory |
/api/ @backend-team @api-lead | Two owner groups for API changes |
apps/web/ @org/frontend | An organization team responsible for part of a monorepo |
The generator does not remove repeated patterns. This is intentional: the last matching CODEOWNERS rule determines ownership, so deleting a later entry would change behavior. The counter includes every generated rule, including an automatically added wildcard.
Differences from .gitignore
The syntax resembles .gitignore, but it is not identical. CODEOWNERS does not support negation beginning with !, character ranges in square brackets, or escaping an initial # with a backslash. The generator detects these cases rather than creating a file that only appears correct. If a path contains a space, prefer a pattern without spaces or rename the directory; this form separates rule elements at whitespace.
Permissions and branch protection
A valid line does not guarantee a review request. A user or team must be visible to the repository and have the required access, while a team should belong to the same organization. The file suggests owners; to require their approval, configure a branch protection rule or ruleset that requires Code Owner reviews. GitLab projects need a separate ownership policy. A GitLab CI generator can help with the pipeline, but its output does not replace CODEOWNERS.
File location and rule maintenance
GitHub searches for the file in .github/, the repository root, or docs/, and uses the first file it finds. The name must be CODEOWNERS without an extension. Rules are read from the pull request base branch, so a change made only on a feature branch will not affect reviewer assignment until it reaches the base branch.
Frequently asked questions
Does CODEOWNERS automatically approve a pull request?
No. It identifies people and can request their review, but it does not submit an approval. Required Code Owner approval must be enabled in branch protection or a repository ruleset.
Can several teams own the same path?
Yes. Add owners after the pattern and separate them with spaces. A review can be requested from each listed user or team as long as it has repository access.
Why does the last rule win?
This allows a broad default to be followed by an override for a sensitive directory or a specific file type. The generator therefore preserves both input order and duplicate patterns.
How can I test the file?
Commit it to the base branch, open a test pull request that changes a selected path, and inspect the requested reviewers. The generator validates local syntax but cannot verify accounts or permissions.
Can an email address be an owner?
GitHub accepts an address associated with an account, but a user or team name is usually clearer and easier to maintain. In a public repository, also consider the privacy impact of exposing an address.