Skip to content

Commit

Permalink
Use anonymous GitHub API when GITHUB_TOKEN is not set
Browse files Browse the repository at this point in the history
Signed-off-by: Alexei Barantsev <barancev@gmail.com>
  • Loading branch information
davehunt authored and barancev committed Jun 4, 2018
1 parent 1692b9b commit 9676d70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ if [[ ! -z $CHROME ]]; then
fi

if [[ ! -z $MARIONETTE ]]; then
export GECKODRIVER_DOWNLOAD=`curl -H "Authorization: token $GITHUB_TOKEN" -s 'https://api.github.com/repos/mozilla/geckodriver/releases/latest' | python -c "import sys, json; r = json.load(sys.stdin); print([a for a in r['assets'] if 'linux64' in a['name']][0]['browser_download_url']);"`
export GITHUB_AUTH="anonymous"
if [[ ! -z $GITHUB_TOKEN ]]; then
export GITHUB_AUTH="token $GITHUB_TOKEN"
export GECKODRIVER_DOWNLOAD=`curl -H "Authorization: $GITHUB_AUTH" -s 'https://api.github.com/repos/mozilla/geckodriver/releases/latest' | python -c "import sys, json; r = json.load(sys.stdin); print([a for a in r['assets'] if 'linux64' in a['name']][0]['browser_download_url']);"`
curl -L -o geckodriver.tar.gz $GECKODRIVER_DOWNLOAD
gunzip -c geckodriver.tar.gz | tar xopf -
chmod +x geckodriver && sudo mv geckodriver /usr/local/bin
Expand Down

0 comments on commit 9676d70

Please sign in to comment.