ruleset

Manage the targeted repository’s rulesets.

Added in version 1.1.0.

Part of the github resource type: states operate on the repository the state run was dispatched to, so there is no repo_name/owner parameter. The profile parameter defaults to the profile named in the resource declaration.

saltext.github.resources.github.states.ruleset.present(name, ruleset_params=None, profile=None)[source]

Ensure a ruleset is present in the targeted repository and configured as specified. Only the parameters included in ruleset_params are compared, server-populated fields are ignored.

Example:

Ensure ruleset test is present:
  ruleset.present:
    - name: test
    - ruleset_params:
        target: branch
        enforcement: active
name

Ruleset name to manage.

ruleset_params

Ruleset definition. Must contain at least enforcement when the ruleset needs to be created. name is pulled from this state’s name.

profile

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

saltext.github.resources.github.states.ruleset.absent(name, profile=None)[source]

Ensure a ruleset is absent from the targeted repository.

name

Ruleset name to manage.

profile

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