From 287c4872fed3cf8d13ad6a2d6681300ca57714bc Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Mon, 15 Oct 2018 03:27:47 +0800 Subject: [PATCH] throw error when forgot to pass in GIT_USER (#1035) --- 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`;