codeowners.star¶
Find and edit CODEOWNERS files.
| Function | What it does |
|---|---|
find |
Finds the CODEOWNERS file GitHub uses. |
owners |
Reads the owners of a CODEOWNERS pattern. |
set_owners |
Makes a list of users or teams the owners of a pattern. |
find¶
Finds the CODEOWNERS file GitHub uses.
GitHub reads the first of .github/CODEOWNERS, CODEOWNERS and docs/CODEOWNERS that exists.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: Its path, or None when the repo has none.
Example
Used in: add-codeowners
owners¶
Reads the owners of a CODEOWNERS pattern.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
pattern |
The pattern exactly as written, such as * or /docs/. |
Returns: The owners of the last rule for the pattern, or an empty list.
Example
set_owners¶
Makes a list of users or teams the owners of a pattern.
The last existing rule for the pattern is replaced; otherwise a rule is added at the end. With no CODEOWNERS file, one is created at .github/CODEOWNERS.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
pattern |
The pattern, such as * or /docs/. |
owners |
A list or a space-separated string of users or teams; a leading @ is added when missing. |
header |
A line, such as a comment, to start a new file with. |
Returns: True when the file changed.
Example
Used in: add-codeowners