community.general.github_repo – Manage your repositories on Github¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.github_repo
.
New in version 2.2.0: of community.general
Synopsis¶
Manages Github repositories using PyGithub library.
Authentication can be done with access_token or with username and password.
Requirements¶
The below requirements are needed on the host that executes this module.
PyGithub>=1.54
Parameters¶
Notes¶
Note
For Python 3, PyGithub>=1.54 should be used.
For Python 3.5, PyGithub==1.54 should be used. More information: https://pygithub.readthedocs.io/en/latest/changes.html#version-1-54-november-30-2020.
For Python 2.7, PyGithub==1.45 should be used. More information: https://pygithub.readthedocs.io/en/latest/changes.html#version-1-45-december-29-2019.
Supports
check_mode
.
Examples¶
- name: Create a Github repository
community.general.github_repo:
access_token: mytoken
organization: MyOrganization
name: myrepo
description: "Just for fun"
private: yes
state: present
register: result
- name: Delete the repository
community.general.github_repo:
username: octocat
password: password
organization: MyOrganization
name: myrepo
state: absent
register: result
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
repo
dictionary
|
success and state is present |
Repository information as JSON. See https://docs.github.com/en/rest/reference/repos#get-a-repository.
|
Authors¶
Álvaro Torres Cogollo (@atorrescogollo)