From e1f3ad24b33f6b4dfced3ec51ce18e75134efdb0 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 14 Feb 2022 15:37:53 +0000 Subject: [PATCH] fix: don't check the $GITHUB_TOKEN if multi-status is disabled (#2464) Since the $GITHUB_TOKEN is required only for the multi-status feature to work, avoid printing an error in case the feature is explicitly disabled and we don't pass $GITHUB_TOKEN to Super-Linter. i.e. don't print: ``` 2022-02-13 14:24:13 [ERROR] Failed to get [GITHUB_TOKEN]! 2022-02-13 14:24:13 [ERROR] [] 2022-02-13 14:24:13 [ERROR] Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports! ``` when `MULTI_STATUS=false`. --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 70c1038b..50abf293 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -563,7 +563,7 @@ GetGitHubVars() { ############################ # Validate we have a value # ############################ - if [ -z "${GITHUB_TOKEN}" ] && [[ ${RUN_LOCAL} == "false" ]]; then + if [ "${MULTI_STATUS}" == "true" ] && [ -z "${GITHUB_TOKEN}" ] && [[ ${RUN_LOCAL} == "false" ]]; then error "Failed to get [GITHUB_TOKEN]!" error "[${GITHUB_TOKEN}]" error "Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!"