Skip to content
tag

GitHub Action

Find Latest Tag of Git repository

v1.0.2 Latest version

Find Latest Tag of Git repository

tag

Find Latest Tag of Git repository

Find latest tag of any Git repository on the Internet

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Find Latest Tag of Git repository

uses: tdemin/find-latest-tag@v1.0.2

Learn more about this action in tdemin/find-latest-tag

Choose a version

Find Latest Tag

Run tests

GitHub Action to find latest tag of any Git repository available on the Internet.

Examples

steps:
  - uses: tdemin/find-latest-tag@v1
    with:
      repo: https://github.com/tdemin/gmnhg.git
    # v0.4.0
  - uses: tdemin@find-latest-tag@v1
    with:
      repo: https://github.com/golang/go.git
      tag: '^go1'
    # go1.17.1

Usage

Inputs

  • repo: required, Git URI of a remote to check tags from.
  • tag: optional, regex to check tag names against (default "").

Private repository authentication is currently not implemented, although you can use the http://user:password@hostname.tld/repo.git URI notation for Git over HTTP(S).

Outputs

  • tag: ${{ steps.STEP_NAME.outputs.tag }}

Errors

This action will fail if any of the conditions are met:

  • Git is unable to ls-remote the repository;
  • there are no tags in the repository;
  • no tags are selected by the tag regular expression.

Sort order

Tags are sorted with sort -V. This has a few noticeable pitfalls:

  • 1.2 goes before 1.2.5;
  • v1.2 goes before 1.2.