Skip to content

Instantly share code, notes, and snippets.

@matt-forster
Created August 30, 2016 18:16
Show Gist options
  • Save matt-forster/53e4f45d36845d3d3790f8d662efe613 to your computer and use it in GitHub Desktop.
Save matt-forster/53e4f45d36845d3d3790f8d662efe613 to your computer and use it in GitHub Desktop.
Get a file from a repo on github - used in CI.
# Get a file from a repo on github
TOKEN=$GITHUB_TOKEN
OWNER=$1
REPO=$2
PATH=$3
FILE="https://api.github.com/repos/$OWNER/$REPO/contents/$PATH"
/usr/bin/curl -v --header "Authorization: token $TOKEN" \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location $FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment