Just retrieving the latest release may not what you want - An LTS v1.1.20 maybe released after another LTS v2.0.10
Example to get highest version, not just latest - because an LTS bugfix 1.2.3 could be released after a new major 3.x version
curl https://api.github.com/repos/docker/compose/releases -s | jq -r .[].tag_name | grep '^v*[0-9]\.[0-9]*\.[0-9]*$' | sort -rV | head -n1