https://github.com/tdemin/find-latest-tag
GitHub Action to retrieve the latest tag of any Git repo
https://github.com/tdemin/find-latest-tag
git github-actions
Last synced: 4 months ago
JSON representation
GitHub Action to retrieve the latest tag of any Git repo
- Host: GitHub
- URL: https://github.com/tdemin/find-latest-tag
- Owner: tdemin
- License: isc
- Created: 2021-09-30T14:32:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-26T00:00:22.000Z (over 2 years ago)
- Last Synced: 2026-02-18T10:35:18.275Z (4 months ago)
- Topics: git, github-actions
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Find Latest Tag
[](https://github.com/tdemin/find-latest-tag/actions/workflows/test.yml)
GitHub Action to find latest tag of any Git repository available on the
Internet.
## Examples
```yml
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`.