Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active December 10, 2023 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magnetikonline/32f224b2e2785867667129bca48cf0da to your computer and use it in GitHub Desktop.
Save magnetikonline/32f224b2e2785867667129bca48cf0da to your computer and use it in GitHub Desktop.
Find latest non beta/RC release for Docker CLI

Find latest non beta/RC release for Docker CLI

Using curl and jq to:

  • Pull list of GitHub release tags.
  • Filter out all that don't match vX.Y.Z (stripping beta/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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment