Lookup release information for a given GitHub repository.
- Lookup release information for a given GitHub repository.
- We can get either the latest release.
- Or we can get a release that matches python-semanticversion SimpleSpec constrain.
- Also we can disable the prereleases from the query.
- semantic-version>=2.10.0
- PyGithub>=1.58.0
- name: Get the latest Terraform final release.
ansible.builtin.debug:
msg: "{{ lookup('vidimensional.collection.github_release', repo='hashicorp/terraform') }}"
- name: Get the latest awscli version(including preseleases).
ansible.builtin.debug:
msg: "{{ lookup('vidimensional.collection.github_release', repo='aws/aws-cli', spec='latest', allow_prereleases=True) }}"
- name: Get latest release from a private repo.
ansible.builtin.debug:
# ⚠️ Be careful not to send the plain text token to your VCS.
msg: "{{ lookup('vidimensional.collection.github_release', repo='myorg/some-private-repo', token='1234') }}"
- name: Get latest Ansible version for branch 2.13
ansible.builtin.debug:
msg: "{{ lookup('vidimensional.collection.github_release', repo='ansible/ansible', spec='>=2.13.0,<2.14') }}"
- Description: GitHub repository to query (
USER/REPO_NAME
). - Type: string
- Required: True
- Version added: 0.0.1
- Description: The query for the release to retrieve. It can be
latest
that would retireve the most recent version. Or it can be apython-semanticversion SimpleSpec
. - Type: string
- Required: False
- Version added: 0.0.1
- Description: If provided, it'd be used to send requests to GitHub API. Useful to avoid API request limit errors or accesing private repos.
- Type: string
- Required: False
- Version added: 0.0.1
- Description: If False it'll ignore the releases with pre-release versions.
- Type: boolean
- Required: False
- Version added: 0.0.1
- Daniel Vidal de la Rubia (@vidimensional)