-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.travis.yml: Check GITHUB_TOKEN before deploy #61
base: master
Are you sure you want to change the base?
Conversation
Need to check this again by pushing to my master. |
It works correctly on master, but needs a nice error message |
410adc9
to
2a3fda4
Compare
Provide a helpful error message early in build when pushing to master without deploy variable GITHUB_TOKEN. Closes coala#60
|
||
set -ex | ||
|
||
if [[ $TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == push && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$TRAVIS_BRANCH" == "master" && "$TRAVIS_EVENT_TYPE" == "push"
is the convention, I believe, so that words with spaces or special characters don't break the script.
if [[ $TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == push && | ||
! "$GITHUB_TOKEN" ]]; then | ||
echo "Please set GITHUB_TOKEN in your Travis CI environment settings" | ||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why false
instead of exit 1
?
Closes #60