codeowners
Creates, updates, deletes, gets or lists a codeowners resource.
Overview
| Name | codeowners |
| Type | Resource |
| Id | github.repos.codeowners |
Fields
The following fields are returned by SELECT queries:
- codeowners_errors
Response
| Name | Datatype | Description |
|---|---|---|
column | integer | The column number where this errors occurs. |
kind | string | The type of error. (example: Invalid owner) |
line | integer | The line number where this errors occurs. |
message | string | 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). (example: Invalid owner on line 7: * user ^) |
path | string | The path of the file where the error occured. (example: .github/CODEOWNERS) |
source | string | The contents of the line where the error occurs. (example: * user) |
suggestion | string | Suggested 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
codeowners_errors | select | owner, repo | ref | List 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.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | 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) |
SELECT examples
- 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."
SELECT
column,
kind,
line,
message,
path,
source,
suggestion
FROM github.repos.codeowners
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND ref = '{{ ref }}'
;