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`.
This commit is contained in:
Frantisek Sumsal 2022-02-14 15:37:53 +00:00 committed by GitHub
parent c1ded5ed7d
commit e1f3ad24b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -563,7 +563,7 @@ GetGitHubVars() {
############################ ############################
# Validate we have a value # # 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 "Failed to get [GITHUB_TOKEN]!"
error "[${GITHUB_TOKEN}]" error "[${GITHUB_TOKEN}]"
error "Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!" error "Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!"