Skip to content

Instantly share code, notes, and snippets.

@kevholditch
Created November 10, 2017 15:55
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 kevholditch/6fd9fce79fd8ee474bb8618f12f7b424 to your computer and use it in GitHub Desktop.
Save kevholditch/6fd9fce79fd8ee474bb8618f12f7b424 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
GITHUB_TOKEN=<my_token>
REPO="kevholditch/demo"
FILE="demo_0.0.1_linux_amd64.tar.gz"
VERSION="v0.0.1"
wget -q --auth-no-challenge --header='Accept:application/octet-stream' \
https://$GITHUB_TOKEN:@api.github.com/repos/$REPO/releases/assets/`curl -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw" -s https://api.github.com/repos/$REPO/releases | jq ". | map(select(.tag_name == \"$VERSION\"))[0].assets | map(select(.name == \"$FILE\"))[0].id"` \
-O /tmp/$FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment