Module for interacting with the GitHub v3 API.
New in version 2016.3.0.
| depends: | PyGithub python module |
|---|
Configure this module by specifying the name of a configuration profile in the minion config, minion pillar, or master config. The module will use the 'github' key by default, if defined.
For example:
github:
token: abc1234
org_name: my_organization
# optional: some functions require a repo_name, which
# can be set in the config file, or passed in at the CLI.
repo_name: my_repo
salt.modules.github.add_repo(name, description=None, homepage=None, private=None, has_issues=None, has_wiki=None, has_downloads=None, auto_init=None, gitignore_template=None, license_template=None, profile='github')¶Create a new github repository.
github.CLI Example:
salt myminion github.add_repo 'repo_name'
New in version 2016.11.0.
salt.modules.github.add_team(name, description=None, repo_names=None, privacy=None, permission=None, profile='github')¶Create a new Github team within an organization.
github.CLI Example:
salt myminion github.add_team 'team_name'
New in version 2016.11.0.
salt.modules.github.add_team_member(name, team_name, profile='github')¶Adds a team member to a team with team_name.
github.CLI Example:
salt myminion github.add_team_member 'user_name' 'team_name'
New in version 2016.11.0.
salt.modules.github.add_team_repo(repo_name, team_name, profile='github')¶Adds a repository to a team with team_name.
github.CLI Example:
salt myminion github.add_team_repo 'my_repo' 'team_name'
New in version 2016.11.0.
salt.modules.github.add_user(name, profile='github')¶Add a GitHub user.
github.CLI Example:
salt myminion github.add_user github-handle
salt.modules.github.edit_repo(name, description=None, homepage=None, private=None, has_issues=None, has_wiki=None, has_downloads=None, profile='github')¶Updates an existing Github repository.
github.CLI Example:
salt myminion github.add_repo 'repo_name'
New in version 2016.11.0.
salt.modules.github.edit_team(name, description=None, privacy=None, permission=None, profile='github')¶Updates an existing Github team.
github.CLI Example:
salt myminion github.edit_team 'team_name' description='Team description'
New in version 2016.11.0.
salt.modules.github.get_issue(issue_number, repo_name=None, profile='github', output='min')¶Return information about a single issue in a named repository.
New in version 2016.11.0.
repo_name passed as a CLI argument will override the
repo_name defined in the configured profile, if provided.github.min. Change
to full to see all issue output.CLI Example:
salt myminion github.get_issue 514
salt myminion github.get_issue 514 repo_name=salt
salt.modules.github.get_issue_comments(issue_number, repo_name=None, profile='github', since=None, output='min')¶Return information about the comments for a given issue in a named repository.
New in version 2016.11.0.
repo_name passed as a CLI argument will override the
repo_name defined in the configured profile, if provided.github.YYYY-MM-DDTHH:MM:SSZ.min. Change
to full to see all issue output.CLI Example:
salt myminion github.get_issue_comments 514
salt myminion github.get_issue 514 repo_name=salt
salt.modules.github.get_issues(repo_name=None, profile='github', milestone=None, state='open', assignee=None, creator=None, mentioned=None, labels=None, sort='created', direction='desc', since=None, output='min', per_page=None)¶Returns information for all issues in a given repository, based on the search options.
New in version 2016.11.0.
repo_name passed as a CLI argument will override the
repo_name defined in the configured profile, if provided.github.The number of a GitHub milestone, or a string of either * or
none.
If a number is passed, it should refer to a milestone by its number
field. Use the github.get_milestone function to obtain a milestone's
number.
If the string * is passed, issues with any milestone are
accepted. If the string none is passed, issues without milestones
are returned.
open,
closed, or all. Default is open.none (as a string) for issues
with no assigned user or * for issues assigned to any user.bug,ui,@high.created, updated, or
comments. Default is created.asc or desc. Default
is desc.YYYY-MM-DDTHH:MM:SSZ.min. Change
to full to see all issue output.CLI Example:
salt myminion github.get_issues my-github-repo
salt.modules.github.get_milestone(number=None, name=None, repo_name=None, profile='github', output='min')¶Return information about a single milestone in a named repository.
New in version 2016.11.0.
name.repo_name passed as a CLI argument will override the
repo_name defined in the configured profile, if provided.github.min. Change
to full to see all issue output.CLI Example:
salt myminion github.get_milestone 72
salt myminion github.get_milestone name=my_milestone
salt.modules.github.get_milestones(repo_name=None, profile='github', state='open', sort='due_on', direction='asc', output='min', per_page=None)¶Return information about milestones for a given repository.
New in version 2016.11.0.
repo_name passed as a CLI argument will override the
repo_name defined in the configured profile, if provided.github.open, closed, or all.
Default is open.due_on or completeness. Default
is due_on.asc or desc. Default is asc.min. Change
to full to see all issue output.CLI Example:
salt myminion github.get_milestones
salt.modules.github.get_repo_info(repo_name, profile='github')¶Return information for a given repo.
New in version 2016.11.0.
github.CLI Example:
salt myminion github.get_repo_info salt
salt myminion github.get_repo_info salt profile='my-github-profile'
salt.modules.github.get_team(name, profile='github')¶Returns the team details if a team with the given name exists, or None otherwise.
github.CLI Example:
salt myminion github.get_team 'team_name'
salt.modules.github.get_user(name, profile='github', user_details=False)¶Get a GitHub user by name.
github.False. If the user is
already in the organization and user_details is set to False, the
get_user function returns True. If the user is not already present
in the organization, user details will be printed by default.CLI Example:
salt myminion github.get_user github-handle
salt myminion github.get_user github-handle user_details=true
salt.modules.github.is_team_member(name, team_name, profile='github')¶Returns True if the github user is in the team with team_name, or False otherwise.
github.CLI Example:
salt myminion github.is_team_member 'user_name' 'team_name'
New in version 2016.11.0.
salt.modules.github.list_members_without_mfa(profile='github', ignore_cache=False)¶List all members (in lower case) without MFA turned on.
github.CLI Example:
salt myminion github.list_members_without_mfa
New in version 2016.11.0.
salt.modules.github.list_private_repos(profile='github')¶List private repositories within the organization. Dependent upon the access rights of the profile token.
New in version 2016.11.0.
github.CLI Example:
salt myminion github.list_private_repos
salt myminion github.list_private_repos profile='my-github-profile'
salt.modules.github.list_public_repos(profile='github')¶List public repositories within the organization.
New in version 2016.11.0.
github.CLI Example:
salt myminion github.list_public_repos
salt myminion github.list_public_repos profile='my-github-profile'
salt.modules.github.list_repos(profile='github')¶List all repositories within the organization. Includes public and private repositories within the organization Dependent upon the access rights of the profile token.
New in version 2016.11.0.
github.CLI Example:
salt myminion github.list_repos
salt myminion github.list_repos profile='my-github-profile'
salt.modules.github.list_team_members(team_name, profile='github', ignore_cache=False)¶Gets the names of team members in lower case.
github.CLI Example:
salt myminion github.list_team_members 'team_name'
New in version 2016.11.0.
salt.modules.github.list_team_repos(team_name, profile='github', ignore_cache=False)¶Gets the names of team repos in lower case.
github.CLI Example:
salt myminion github.list_team_repos 'team_name'
New in version 2016.11.0.
salt.modules.github.list_teams(profile='github', ignore_cache=False)¶Lists all teams with the organization.
github.CLI Example:
salt myminion github.list_teams
New in version 2016.11.0.
salt.modules.github.list_users(profile='github', ignore_cache=False)¶List all users within the organization.
github.Bypasses the use of cached users.
New in version 2016.11.0.
CLI Example:
salt myminion github.list_users
salt myminion github.list_users profile='my-github-profile'
salt.modules.github.remove_repo(name, profile='github')¶Remove a Github repository.
github.CLI Example:
salt myminion github.remove_repo 'my-repo'
New in version 2016.11.0.
salt.modules.github.remove_team(name, profile='github')¶Remove a github team.
github.CLI Example:
salt myminion github.remove_team 'team_name'
New in version 2016.11.0.
salt.modules.github.remove_team_member(name, team_name, profile='github')¶Removes a team member from a team with team_name.
github.CLI Example:
salt myminion github.remove_team_member 'user_name' 'team_name'
New in version 2016.11.0.
salt.modules.github.remove_team_repo(repo_name, team_name, profile='github')¶Removes a repository from a team with team_name.
github.CLI Example:
salt myminion github.remove_team_repo 'my_repo' 'team_name'
New in version 2016.11.0.
salt.modules.github.remove_user(name, profile='github')¶Remove a Github user by name.
github.CLI Example:
salt myminion github.remove_user github-handle