actions

Manage the targeted repository’s Actions secrets and workflow permissions.

Added in version 1.1.0.

Part of the github resource type: all functions operate on the repository the job was dispatched to. The profile parameter defaults to the profile named in the resource declaration.

saltext.github.resources.github.modules.actions.list_secrets(*, fields=None, profile=None)[source]

List the Actions secrets of the targeted repository, as a mapping of secret name to metadata. Secret values are write-only, so this only returns metadata (created_at, updated_at).

CLI Example:

salt 'my-org/my-repo' actions.list_secrets
fields

Only include these fields in the output. A single field name reduces each entry to the field’s value.

profile

Profile configuration name to use. Defaults to the resource declaration’s profile.

saltext.github.resources.github.modules.actions.get_secret(name, *, profile=None)[source]

Return the metadata of a single Actions secret of the targeted repository. The value itself is write-only and cannot be retrieved.

CLI Example:

salt 'my-org/my-repo' actions.get_secret MY_SECRET
name

Name of the secret.

profile

Profile configuration name to use. Defaults to the resource declaration’s profile.

saltext.github.resources.github.modules.actions.set_secret(name, value, *, profile=None)[source]

Create or update an Actions secret of the targeted repository. The value is encrypted to the repository public key before leaving the minion.

CLI Example:

salt 'my-org/my-repo' actions.set_secret MY_SECRET hunter2
name

Name of the secret.

value

Plaintext secret value.

profile

Profile configuration name to use. Defaults to the resource declaration’s profile.

saltext.github.resources.github.modules.actions.remove_secret(name, *, profile=None)[source]

Remove an Actions secret from the targeted repository.

CLI Example:

salt 'my-org/my-repo' actions.remove_secret MY_SECRET
name

Name of the secret.

profile

Profile configuration name to use. Defaults to the resource declaration’s profile.

saltext.github.resources.github.modules.actions.get_workflow_permissions(*, profile=None)[source]

Return the default workflow permissions granted to the GITHUB_TOKEN in the targeted repository, a mapping with default_workflow_permissions (read/write) and can_approve_pull_request_reviews.

CLI Example:

salt 'my-org/my-repo' actions.get_workflow_permissions
profile

Profile configuration name to use. Defaults to the resource declaration’s profile.

saltext.github.resources.github.modules.actions.set_workflow_permissions(*, default_workflow_permissions=None, can_approve_pull_request_reviews=None, profile=None)[source]

Update the default workflow permissions granted to the GITHUB_TOKEN in the targeted repository.

CLI Example:

salt 'my-org/my-repo' actions.set_workflow_permissions \
    default_workflow_permissions=read can_approve_pull_request_reviews=true
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.

profile

Profile configuration name to use. Defaults to the resource declaration’s profile.