community.general.github_release (8.5.0) — module

Interact with GitHub Releases

Authors: Adrian Moisey (@adrianmoisey)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

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
  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 O(action=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: false
    description:
    - Sets if the release is a draft or not. (boolean)
    type: bool

token:
    description:
    - GitHub Personal Access Token for authenticating. Mutually exclusive with O(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 O(token).
    type: str

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

Outputs

tag:
  description: Version of the created/latest release.
  returned: success
  sample: 1.1.0
  type: str