saltext.github.utils.gh.labels

Operations on GitHub repository (issue) labels.

saltext.github.utils.gh.labels.normalize_color(color)[source]

Normalize a label color for comparisons: lowercase, no leading #.

color

Hexadecimal color code to normalize.

saltext.github.utils.gh.labels.list_all(conn, repo_name, *, owner=None)[source]

Return all labels of a repository.

conn

GitHubConnection to use.

repo_name

Repository name.

owner

Owner of the repository. Defaults to the connection’s owner.

saltext.github.utils.gh.labels.get(conn, repo_name, name, *, owner=None)[source]

Return the data of a single label.

conn

GitHubConnection to use.

repo_name

Repository name.

name

Label name.

owner

Owner of the repository. Defaults to the connection’s owner.

Raises GitHubNotFoundError if the label does not exist.

saltext.github.utils.gh.labels.create(conn, repo_name, name, *, color=None, description=None, owner=None)[source]

Create a label in a repository. Returns the data of the created label.

conn

GitHubConnection to use.

repo_name

Repository name.

name

Label name.

color

Hexadecimal color code for the label, without the leading #. If unset, GitHub assigns a random one.

description

Short description of the label.

owner

Owner of the repository. Defaults to the connection’s owner.

saltext.github.utils.gh.labels.update(conn, repo_name, name, *, new_name=None, color=None, description=None, owner=None)[source]

Update an existing label. Returns the data of the updated label.

conn

GitHubConnection to use.

repo_name

Repository name.

name

Current label name.

new_name

New name for the label.

color

Hexadecimal color code for the label, without the leading #.

description

Short description of the label.

owner

Owner of the repository. Defaults to the connection’s owner.

saltext.github.utils.gh.labels.delete(conn, repo_name, name, *, owner=None)[source]

Delete a label from a repository.

conn

GitHubConnection to use.

repo_name

Repository name.

name

Label name.

owner

Owner of the repository. Defaults to the connection’s owner.