Skip to content

Instantly share code, notes, and snippets.

@kevholditch
Created November 10, 2017 16:06
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/448edbf629b18bf644e16343a55ca479 to your computer and use it in GitHub Desktop.
Save kevholditch/448edbf629b18bf644e16343a55ca479 to your computer and use it in GitHub Desktop.
ARG GITHUB_TOKEN
ENV REPO "kevholditch/demo"
ENV FILE "demo_0.0.1_linux_amd64.tar.gz"
ENV 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