Skip to content

Commit 2a3fda4

Browse files
committed
.travis.yml: Check GITHUB_TOKEN before deploy
Provide a helpful error message early in build when pushing to master without deploy variable GITHUB_TOKEN. Closes #60
1 parent 7203790 commit 2a3fda4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.ci/check_travis_deploy_vars.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
if [[ $TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == push &&
6+
! "$GITHUB_TOKEN" ]]; then
7+
echo "Please set GITHUB_TOKEN in your Travis CI environment settings"
8+
false
9+
fi

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
script: coala --non-interactive -V
4848

4949
before_install:
50+
- .ci/check_travis_deploy_vars.sh
5051
- npm config set spin false
5152

5253
before_script:

0 commit comments

Comments
 (0)