community.general.github_release (3.8.10) — module

Interact with GitHub Releases

Authors: Adrian Moisey (@adrianmoisey)

Install collection

Install with ansible-galaxy collection install community.general:==3.8.10


Add to requirements.yml

  collections:
    - name: community.general
      version: 3.8.10

Description

Fetch metadata about GitHub Releases


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get latest release of a public repository
  community.general.github_release:
    user: ansible
    repo: ansible
    action: latest_release
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get latest release of testuseer/testrepo
  community.general.github_release:
    token: tokenabc1234567890
    user: testuser
    repo: testrepo
    action: latest_release
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
tag:
    description:
    - Tag name when creating a release. Required when using action is set to C(create_release).
    type: str

body:
    description:
    - Description of the release when creating a release
    type: str

name:
    description:
    - Name of release when creating a release
    type: str

repo:
    description:
    - Repository name
    required: true
    type: str

user:
    description:
    - The GitHub account that owns the repository
    required: true
    type: str

draft:
    default: 'no'
    description:
    - Sets if the release is a draft or not. (boolean)
    type: bool

token:
    description:
    - GitHub Personal Access Token for authenticating. Mutually exclusive with C(password).
    type: str

action:
    choices:
    - latest_release
    - create_release
    description:
    - Action to perform
    required: true
    type: str

target:
    description:
    - Target of release when creating a release
    type: str

password:
    description:
    - The GitHub account password for the user. Mutually exclusive with C(token).
    type: str

prerelease:
    default: 'no'
    description:
    - Sets if the release is a prerelease or not. (boolean)
    type: bool

Outputs

create_release:
  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
  type: str
latest_release:
  description: Version of the latest release
  returned: success
  sample: 1.1.0
  type: str