Skip to main content

codeowners

Creates, updates, deletes, gets or lists a codeowners resource.

Overview

Namecodeowners
TypeResource
Idgithub.repos.codeowners

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
columnintegerThe column number where this errors occurs.
kindstringThe type of error. (example: Invalid owner)
lineintegerThe line number where this errors occurs.
messagestringA 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). (example: Invalid owner on line 7:

* user
^)
pathstringThe path of the file where the error occured. (example: .github/CODEOWNERS)
sourcestringThe contents of the line where the error occurs. (example: * user)
suggestionstringSuggested action to fix the error. This will usually be null, but is provided for some common errors. (example: The pattern / will never match anything, did you mean * instead?)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
codeowners_errorsselectowner, reporefList any syntax errors that are detected in the CODEOWNERS
file.

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

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
refstringA 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)

SELECT examples

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

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

SELECT
column,
kind,
line,
message,
path,
source,
suggestion
FROM github.repos.codeowners
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND ref = '{{ ref }}'
;