Using curl
and jq
to:
- Pull list of GitHub release tags.
- Filter out all that don't match
vX.Y.Z
(strippingbeta
/rc
). - Finally return just the first entry (latest tag).
$ curl --silent \
"https://api.github.com/repos/docker/cli/tags" | \
jq --raw-output '[.[] | select(.name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+$")) | .name] | first'