Skip to content

Commit

Permalink
.travis.yml: Check GITHUB_TOKEN before deploy
Browse files Browse the repository at this point in the history
Provide a helpful error message early in build when
pushing to master without deploy variable GITHUB_TOKEN.

Closes #60
  • Loading branch information
jayvdb committed Jun 13, 2018
1 parent 7203790 commit 2a3fda4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .ci/check_travis_deploy_vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -ex

if [[ $TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == push &&
! "$GITHUB_TOKEN" ]]; then
echo "Please set GITHUB_TOKEN in your Travis CI environment settings"
false
fi
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
script: coala --non-interactive -V

before_install:
- .ci/check_travis_deploy_vars.sh
- npm config set spin false

before_script:
Expand Down

0 comments on commit 2a3fda4

Please sign in to comment.