CODEOWNERS & Review Policy Auditor

CODEOWNERS decides who gets asked to review what. The files nobody owns are the ones that slip through.

A CODEOWNERS file is the GitHub file that maps paths in a repository to the people or teams who must be asked to review changes to them. Paste yours here — and, if you have one, the output of git ls-files — and this auditor reads both in your browser, never uploaded, and flags rules with no owner, malformed owner tokens, shadowed duplicate patterns, patterns that match nothing, files no rule covers, and high-risk paths left to a single individual. The companion article CODEOWNERS and review policy explains the semantics people get wrong. Also see the GitHub Actions Workflow Auditor.

Last updated:

1. Audit a CODEOWNERS file

Drop a CODEOWNERS file here, or choose one below

A CODEOWNERS file from the repository root, docs/ or .github/. Up to 1 MB — parsed in your browser.

One path per line — for example the output of git ls-files. With a list, the auditor reports which files no rule owns. Up to 10,000 paths.

🔒 The audit runs entirely in your browser: your CODEOWNERS file and file list are never uploaded, never stored, and never sent anywhere.

What a CODEOWNERS file is

A CODEOWNERS file lives in the repository root, docs/ or .github/. Each non-comment line is a pattern, then one or more owners: @user, @org/team or an email address. When a pull request touches a path, GitHub requests reviews from the owners of the last pattern that matches it — that is all CODEOWNERS does: it routes review requests. It does not, by itself, block a merge.

Patterns follow the gitignore format with CODEOWNERS differences: there is no negation (!pattern does not work), and a pattern that matches a directory assigns its owners to everything inside it. A pattern with a slash in it is anchored to the repository root; a pattern without one matches a file or directory name at any depth. * does not cross /; ** does.

Last match wins is the rule people get wrong most. If docs/ appears twice, the first line is dead text — it never applies to anything. And a pattern with no owner after it is a syntax error GitHub silently ignores, which means the paths it was meant to cover fall back to an earlier rule — or to nobody.

Owners come in three shapes: an individual (@alice), a team (@acme/docs-team) and an email. Teams survive people leaving; individuals do not. A high-risk path — a workflow file, a lockfile, a migration, an .env file — owned by one individual is one holiday or one resignation away from having no reviewer at all.

What this auditor does — and what it does not

It parses the CODEOWNERS file line by line and checks: patterns with no owner, owner tokens that are neither @handles nor emails, duplicate patterns shadowed by a later line, and a file that routes everything through one catch-all * rule. When you add a file list, it also computes coverage — the last matching rule for every listed file — and flags patterns that match nothing, files with no owner, and high-risk paths unowned or owned by a single individual. Results are a 0–100 score with a verdict, findings grouped by severity with a fix for each, a coverage table, and CSV and JSON exports. Without a list the score is syntax-only; with a list it blends 60% syntax and 40% coverage.

It does not judge intent: a finding is a pattern that matched, not a verdict. A pattern that matches nothing in your list may cover files the list did not include; a single individual may be exactly the right owner for a personal project. Read each finding with its evidence, then decide.

The broken demo is a synthetic CODEOWNERS file with 10 rules plus a 12-path file list, built to trip the rules on purpose: a rule with no owner, two malformed owner tokens, a shadowed duplicate, a pattern that matches nothing, a migration owned by one individual, and one file left unowned. It scores 83. The clean demo loads a fixed file against the same list and scores 100.

Be honest about what this audit cannot see

This tool audits the file, not the GitHub organisation. It cannot check that a team exists, that the team has write access to the repository, or that its members can actually review — a perfectly valid @acme/docs-team line may name a team that was deleted last year. It also cannot see branch protection: required approvals, including “require review from Code Owners”, live in repository settings, not in CODEOWNERS.

And a clean audit is not a working review policy. “No findings” means the file is syntactically sound and — with a list — every listed file has an owner. Whether those owners respond, whether protection rules force the review to happen, and whether the list you pasted matches the real repository are all outside what a file audit can prove.

Key facts

Last match winsWhen several patterns match a path, only the last one in the file decides the owners. Earlier matches — including an identical duplicate pattern — never apply.
Code ownerA user, team or email named after a pattern. GitHub requests a review from the code owners whenever a pull request changes a path they own.
CoverageThe share of repository files whose last matching rule names at least one owner. Files no rule claims get no requested reviewer.
Catch-all ruleA single * pattern that owns everything. Legal, and better than nothing — but it routes every review to the same people, which is no routing at all.
Branch protectionRepository settings that can require pull requests to be approved — including by code owners — before merging. CODEOWNERS alone does not enforce anything.
Format referenceAbout code owners — GitHub Docs

Frequently asked questions

Why does the audit run in my browser instead of on a server?

Because a CODEOWNERS file plus a full file list is a map of your repository: its structure, its sensitive paths and the people responsible for each. That map is exactly what an attacker would want. Parsing it locally means it never leaves your machine.

Does CODEOWNERS block merges until owners approve?

No. CODEOWNERS only requests the reviews. Blocking comes from branch protection: the “Require a pull request before merging” and “Require review from Code Owners” settings in the repository. A repository can have a perfect CODEOWNERS file and still merge unreviewed code if protection is off — which is why this auditor is honest that it checks the file, not the settings.

My file scores 100 — is my review policy done?

The file is done; the policy may not be. Check that the teams named actually exist and include people who can review, turn on branch protection with code-owner review required for the branches that matter, and re-run the audit with a fresh git ls-files list whenever directories are added — new top-level folders are where unowned files appear first.