artis3n.github.latest_release (1.0.0) — lookup

Get the latest tagged release version from a public Github repository.

| "added in version" 2.9 of artis3n.github"

Authors: Ari Kalfus (@artis3n) <dev@quantummadness.com>

Install collection

Install with ansible-galaxy collection install artis3n.github:==1.0.0


Add to requirements.yml

  collections:
    - name: artis3n.github
      version: 1.0.0

Description

This lookup returns the latest tagged release version of a public Github repository.

A future version will accept an optional Github token to allow lookup of private repositories.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Strip the 'v' out of the tag version, e.g. 'v1.0.0' -> '1.0.0'
  set_fact:
    ansible_version: "{{ lookup('artis3n.github.latest_release', 'ansible/ansible')[1:] }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Operate on multiple repositories
  git:
    repo: https://github.com/{{ item }}.git
    version: "{{ lookup('artis3n.github.latest_release', item) }}"
    dest: "{{ lookup('env', 'HOME') }}/projects"
  with_items:
    - ansible/ansible
    - ansible/molecule
    - ansible/awx

Inputs

    
repos:
    description: A list of Github repositories from which to retrieve versions.
    required: true

Outputs

_list:
  description:
  - List of latest Github repository version(s)
  type: list

See also