salt.modules.github module

Module for interacting with the GitHub v3 API.

New in version 2016.3.0..

depends:PyGithub python module

Configuration

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: only some functions, such as 'add_user',
  # require a dev_team_id
  dev_team_id: 1234
salt.modules.github.add_user(name, profile='github')

Add a GitHub user.

name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to github.

CLI Example:

salt myminion github.add_user github-handle
salt.modules.github.get_user(name, profile='github', user_details=False)

Get a GitHub user by name.

name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to github.
user_details
Prints user information details. Defaults to 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.list_users(profile='github')

List all users within the organization.

profile
The name of the profile configuration to use. Defaults to github.

CLI Example:

salt myminion github.list_users
salt myminion github.list_users profile='my-github-profile'
salt.modules.github.remove_user(name, profile='github')

Remove a Github user by name.

name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to github.

CLI Example:

salt myminion github.remove_user github-handle