GitHub: Download Latest Release Link

A GitHub’s release feature allows to provide links to download specific versions of a published software.

However, if you need to download the latest version of a package, you will have to update the version number in the URL each time a new release is made.

This post shows how to make a direct link to download the latest release of a file from an asset on GitHub.

Cool Tip: How to run jobs in parallel in Github Actions! Read more →

GitHub Latest Release Download Link

By default, a releases page on GitHub provides links to specific versions of files that correspond to particular releases:

However, it is possible to modify version-specific URLs so that they always link to the latest release version of files on GitHub.

To download the latest version of a release asset from GitHub, execute:

$ curl -LO https://github.com/<USER>/<PROJECT>/releases/latest/download/<ASSET_FILE_NAME>
- example -
$ curl -LO https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64

If you need to download a specific version of a release asset from GitHub, execute:

$ curl -LO https://github.com/<USER>/<PROJECT>/releases/download/<VERSION>/<ASSET_FILE_NAME>
- example -
$ curl -LO https://github.com/argoproj/argo-cd/releases/download/v2.8.0/argocd-linux-amd64

Option Description
-L, --location Follow redirects.
-O, --remote-name Write output to a file named as the remote file.

Now, you know how to change the URL so that it always points to the latest release version of a file on GitHub.

Was it useful? Share this post with the world!

Leave a Reply