From 2a3fda4fe04139c408e84960241ef57ecc2ed5d1 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Wed, 13 Jun 2018 11:14:08 +0700 Subject: [PATCH] .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 https://github.com/coala/git-task-list/issues/60 --- .ci/check_travis_deploy_vars.sh | 9 +++++++++ .travis.yml | 1 + 2 files changed, 10 insertions(+) create mode 100755 .ci/check_travis_deploy_vars.sh diff --git a/.ci/check_travis_deploy_vars.sh b/.ci/check_travis_deploy_vars.sh new file mode 100755 index 0000000..32bce9f --- /dev/null +++ b/.ci/check_travis_deploy_vars.sh @@ -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 diff --git a/.travis.yml b/.travis.yml index e4719c6..dd2624a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: