From 04e6f53b9b3cf480ab9c8aa5025821d066516ea6 Mon Sep 17 00:00:00 2001 From: Li Hau Tan Date: Sun, 14 Oct 2018 17:23:07 +0800 Subject: [PATCH] throw error when forgot to pass in GIT_USER (#1025) --- v1/lib/publish-gh-pages.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/v1/lib/publish-gh-pages.js b/v1/lib/publish-gh-pages.js index 9aeb8c868909..82b5e9d98588 100755 --- a/v1/lib/publish-gh-pages.js +++ b/v1/lib/publish-gh-pages.js @@ -54,6 +54,13 @@ if (!PROJECT_NAME) { shell.exit(0); } +if (USE_SSH !== 'true' && !GIT_USER) { + shell.echo( + "Missing git user. Did you forget to export the 'GIT_USER' environment variable?", + ); + shell.exit(0); +} + let remoteBranch; if (USE_SSH === 'true') { remoteBranch = `git@${GITHUB_HOST}:${ORGANIZATION_NAME}/${PROJECT_NAME}.git`;