saltext.github.utils.gh.statecores.actions

State cores managing repository Actions secrets and workflow permissions.

saltext.github.utils.gh.statecores.actions.secret_present(conn, name, repo_name, *, value=None, force=False, owner=None, test=False)[source]

Ensure an Actions secret is present in a repository.

Secret values are write-only in the GitHub API, so this core cannot detect value drift. By default, an existing secret is left untouched. Set force to push the value on every run.

conn

GitHubConnection to use.

name

Name of the secret. GitHub treats secret names case-insensitively.

repo_name

Name of the repository.

value

Plaintext secret value. Required when the secret does not exist yet or force is set.

force

Push the value even when the secret already exists. Defaults to false.

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.actions.secret_absent(conn, name, repo_name, *, owner=None, test=False)[source]

Ensure an Actions secret is absent from a repository.

conn

GitHubConnection to use.

name

Name of the secret. GitHub treats secret names case-insensitively.

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).

saltext.github.utils.gh.statecores.actions.workflow_permissions_managed(conn, name, repo_name, *, default_workflow_permissions=None, can_approve_pull_request_reviews=None, owner=None, test=False)[source]

Manage the default workflow permissions granted to the GITHUB_TOKEN in a repository.

conn

GitHubConnection to use.

name

State name (reported back unchanged).

repo_name

Name of the repository.

default_workflow_permissions

Default permissions for the GITHUB_TOKEN, either read or write.

can_approve_pull_request_reviews

Allow GitHub Actions to approve pull requests.

owner

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

test

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