Skip to content

List CODEOWNERS errors

GET
/repos/{owner}/{repo}/codeowners/errors

List any syntax errors that are detected in the CODEOWNERS file.

For more information about the correct CODEOWNERS syntax, see “About code owners.”

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

ref
string

A branch, tag or commit name used to determine which version of the CODEOWNERS file to use. Default: the repository’s default branch (e.g. main)

Response

Media type application/json
CODEOWNERS errors

A list of errors found in a repo’s CODEOWNERS file

object
errors
required
Array<object>
object
line
required

The line number where this errors occurs.

integer
column
required

The column number where this errors occurs.

integer
source

The contents of the line where the error occurs.

string
kind
required

The type of error.

string
suggestion

Suggested action to fix the error. This will usually be null, but is provided for some common errors.

string
nullable
message
required

A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting).

string
path
required

The path of the file where the error occured.

string
Examples
Example default
{
"errors": [
{
"line": 3,
"column": 1,
"kind": "Invalid pattern",
"source": "***/*.rb @monalisa",
"suggestion": "Did you mean `**/*.rb`?",
"message": "Invalid pattern on line 3: Did you mean `**/*.rb`?\n\n ***/*.rb @monalisa\n ^",
"path": ".github/CODEOWNERS"
},
{
"line": 7,
"column": 7,
"kind": "Invalid owner",
"source": "*.txt docs@",
"suggestion": null,
"message": "Invalid owner on line 7:\n\n *.txt docs@\n ^",
"path": ".github/CODEOWNERS"
}
]
}

Resource not found