From 90ce58c56b50fc000abf8770290fbda9d1108a38 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Thu, 11 Apr 2019 10:09:10 -0500 Subject: [PATCH] fix: require a github token to perform a release (#1150) The release would fail when attempting to upload release notes if a github token wasn't in the environment. This will check the environment before running the commands so we don't have to back out a tag midway through. --- release.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release.sh b/release.sh index 326d893658..7c6d6841ab 100755 --- a/release.sh +++ b/release.sh @@ -5,6 +5,12 @@ cd $DIR set -e +# Ensure that the GITHUB_TOKEN is exposed in the environment. +if ! env | grep GITHUB_TOKEN= > /dev/null; then + echo "GITHUB_TOKEN must be exported in the environment to perform a release." 2>&1 + exit 1 +fi + export GO111MODULE=on version=$(go run ./internal/cmd/changelog nextver)