Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jayvdb
Copy link
Member

@jayvdb jayvdb commented Jun 13, 2018

Closes #60

@jayvdb
Copy link
Member Author

jayvdb commented Jun 13, 2018

Need to check this again by pushing to my master.

@jayvdb
Copy link
Member Author

jayvdb commented Jun 13, 2018

It works correctly on master, but needs a nice error message
https://travis-ci.org/jayvdb/gsoc-prep-tasks/jobs/391596692

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 &&
Copy link
Member

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
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants