community.general.github_release – Interact with GitHub Releases
Note
This plugin is part of the community.general collection (version 3.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.github_release
.
Requirements
The below requirements are needed on the host that executes this module.
github3.py >= 1.0.0a3
Parameters
Parameter |
Comments |
---|---|
Action to perform Choices:
|
|
Description of the release when creating a release |
|
Sets if the release is a draft or not. (boolean) Choices:
|
|
Name of release when creating a release |
|
The GitHub account password for the user. Mutually exclusive with |
|
Sets if the release is a prerelease or not. (boolean) Choices:
|
|
Repository name |
|
Tag name when creating a release. Required when using action is set to |
|
Target of release when creating a release |
|
GitHub Personal Access Token for authenticating. Mutually exclusive with |
|
The GitHub account that owns the repository |
Examples
- name: Get latest release of a public repository
community.general.github_release:
user: ansible
repo: ansible
action: latest_release
- name: Get latest release of testuseer/testrepo
community.general.github_release:
token: tokenabc1234567890
user: testuser
repo: testrepo
action: latest_release
- name: Get latest release of test repo using username and password. Ansible 2.4.
community.general.github_release:
user: testuser
password: secret123
repo: testrepo
action: latest_release
- name: Create a new release
community.general.github_release:
token: tokenabc1234567890
user: testuser
repo: testrepo
action: create_release
tag: test
target: master
name: My Release
body: Some description
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Version of the created release For Ansible version 2.5 and later, if specified release version already exists, then State is unchanged For Ansible versions prior to 2.5, if specified release version already exists, then State is skipped Returned: success Sample: “1.1.0” |
|
Version of the latest release Returned: success Sample: “1.1.0” |
Authors
Adrian Moisey (@adrianmoisey)