saltext.github.utils.gh.statecores.environments

State core managing repository (deployment) environments.

saltext.github.utils.gh.statecores.environments.present(conn, name, repo_name, *, wait_timer=None, prevent_self_review=None, reviewers=None, deployment_branches=None, owner=None, test=False)[source]

Ensure an environment is present in a repository and configured as specified. Unspecified settings are left unmanaged.

conn

GitHubConnection to use.

name

Name of the environment.

repo_name

Name of the repository.

wait_timer

Amount of time to delay a job after it is initially triggered, in minutes.

prevent_self_review

Prevent a user who created a job from approving it.

reviewers

People or teams that may review jobs that reference the environment, as a list of mappings with type (User or Team) and id.

deployment_branches

Which branches can deploy to this environment. Either all, protected (branches with branch protection rules) or a list of branch name patterns.

owner

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

test

Only project the changes without applying them (test mode).

saltext.github.utils.gh.statecores.environments.absent(conn, name, repo_name, *, owner=None, test=False)[source]

Ensure an environment is absent from a repository.

conn

GitHubConnection to use.

name

Name of the environment.

repo_name

Name of the repository.

owner

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

test

Only project the changes without applying them (test mode).