github_org¶
Manage a GitHub organization: members, teams and organization rulesets.
Added in version 1.1.0.
- saltext.github.states.github_org.member_present(name, profile='github')[source]¶
Ensure a user is a member of the organization. Since GitHub memberships require an invitation, this cannot be achieved in a single run: Once the user has been invited, this state reports success while the membership state is
pending.- name
GitHub login of the user.
- profile
Profile configuration name to use. Defaults to
github.
- saltext.github.states.github_org.member_absent(name, profile='github')[source]¶
Ensure a user is not a member of the organization.
- name
GitHub login of the user.
- profile
Profile configuration name to use. Defaults to
github.
- saltext.github.states.github_org.team_present(name, description=None, repo_names=None, privacy=None, permission=None, members=None, profile='github')[source]¶
Ensure a named team exists as specified. Unspecified settings are left unmanaged.
Note
Unlike the deprecated
github.team_presentstate, this state does not implement per-team MFA enforcement. Require 2FA for the whole organization in its GitHub settings instead.- name
Name of the team in the organization.
- description
Team description.
- repo_names
List of repository names the team should have access to. Unlisted repositories are removed from the team.
- privacy
Privacy level for the team, either
secretorclosed.- permission
Default permission for new repositories added to the team, either
pull,pushoradmin.- members
Login handles of team members. Unlisted members are removed from the team.
- profile
Profile configuration name to use. Defaults to
github.
- saltext.github.states.github_org.team_absent(name, profile='github')[source]¶
Ensure a named team does not exist.
- name
Name of the team in the organization.
- profile
Profile configuration name to use. Defaults to
github.
- saltext.github.states.github_org.ruleset_present(name, ruleset_params=None, profile='github')[source]¶
Ensure an organization ruleset exists as specified. Only the parameters included in
ruleset_paramsare compared, server-populated fields are ignored.Example:
Ensure ruleset test is present in the org: github_org.ruleset_present: - name: test - ruleset_params: target: branch enforcement: active
- name
Ruleset name to manage.
- ruleset_params
Ruleset definition. Must contain at least
enforcementwhen the ruleset needs to be created.nameis pulled from this state’sname.- profile
Profile configuration name to use. Defaults to
github.