community.general.github_release module – Interact with GitHub Releases
Note
This module is part of the community.general collection (version 9.5.0).
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
. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: community.general.github_release
.
Synopsis
- Fetch metadata about GitHub Releases
Requirements
The below requirements are needed on the host that executes this module.
- github3.py >= 1.0.0a3
Parameters
Parameter | Comments |
---|---|
action string / required | Action to perform Choices:
|
body string | Description of the release when creating a release |
draft boolean | Sets if the release is a draft or not. (boolean) Choices:
|
name string | Name of release when creating a release |
password string | The GitHub account password for the user. Mutually exclusive with |
prerelease boolean | Sets if the release is a prerelease or not. (boolean) Choices:
|
repo string / required | Repository name |
tag string | Tag name when creating a release. Required when using |
target string | Target of release when creating a release |
token string | GitHub Personal Access Token for authenticating. Mutually exclusive with |
user string / required | The GitHub account that owns the repository |
Attributes
Attribute | Support | Description |
---|---|---|
check_mode | Support: full | Can run in |
diff_mode | Support: none | Will return details on what has changed (or possibly needs changing in |
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 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 |
---|---|
tag string | Version of the created/latest release. Returned: success Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/github_release_module.html