Skip to content

Instantly share code, notes, and snippets.

@vireshas
Created August 26, 2016 10:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vireshas/bc914b9932f4bde5e0755ae4091b4a67 to your computer and use it in GitHub Desktop.
Save vireshas/bc914b9932f4bde5e0755ae4091b4a67 to your computer and use it in GitHub Desktop.
Download binaries from github
First, to get a list of the assets for the latest release:
curl -H "Authorization: token YOURGITHUBTOKEN" https://api.github.com/repos/NAME/REPO/releases/latest
Then in the JSON, look up the url of the asset you want. For example it would look like: "url": "https://api.github.com/repos/NAME/REPO/releases/assets/1275759"
Then you pass this to another curl command to retrieve the actual URL, which is actually a link to an Amazon S3 file.
curl -H "Authorization: token YOURGITHUBTOKEN" -H "Accept:application/octet-stream" -i https://api.github.com/repos/NAME/REPO/releases/assets/1275759
The URL will be in the "location" field of the HTTP response, and then use curl to get the file like this:
curl "https://github-cloud.s3.amazonaws.com...." -i -o FILENAME
@neilyoung
Copy link

Sadly outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment