Skip to content

Commit 7c85bf3

Browse files
authored
fix: create log groups for enabled languages only (#7329)
Create GitHub Actions log groups only when the user enabled a language to avoid that users see empty log groups for languages that they disabled when debug logging is not enabled. Fix #7307
1 parent 7afe608 commit 7c85bf3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/functions/worker.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ function LintCodebase() {
77
local TEST_CASE_RUN
88
TEST_CASE_RUN="${1}" && shift
99

10-
startGitHubActionsLogGroup "${FILE_TYPE}"
11-
1210
declare -n VALIDATE_LANGUAGE
1311
VALIDATE_LANGUAGE="VALIDATE_${FILE_TYPE}"
1412

1513
if [[ "${VALIDATE_LANGUAGE}" == "false" ]]; then
1614
if [[ "${TEST_CASE_RUN}" == "false" ]]; then
1715
debug "Skip validation of ${FILE_TYPE} because VALIDATE_LANGUAGE is ${VALIDATE_LANGUAGE}"
1816
unset -n VALIDATE_LANGUAGE
19-
endGitHubActionsLogGroup "${FILE_TYPE}"
2017
return 0
2118
else
2219
if [[ "${FIX_MODE_TEST_CASE_RUN}" == "true" ]]; then
2320
debug "Don't fail the test even if VALIDATE_${FILE_TYPE} is set to ${VALIDATE_LANGUAGE} because ${FILE_TYPE} might not support fix mode"
24-
endGitHubActionsLogGroup "${FILE_TYPE}"
2521
return 0
2622
else
27-
endGitHubActionsLogGroup "${FILE_TYPE}"
2823
fatal "Don't disable any validation when running in test mode. VALIDATE_${FILE_TYPE} is set to: ${VALIDATE_LANGUAGE}. Set it to: true"
2924
fi
3025
fi
3126
fi
3227

28+
# Start the log group now that Super-linter checked that linting/formatting
29+
# for FILE_TYPE is enabled, so it doesn't show users empty log groups if
30+
# users didn't enable debug logging, and disabled some languages.
31+
startGitHubActionsLogGroup "${FILE_TYPE}"
32+
3333
debug "Running LintCodebase. FILE_TYPE: ${FILE_TYPE}. TEST_CASE_RUN: ${TEST_CASE_RUN}"
3434

3535
debug "VALIDATE_LANGUAGE for ${FILE_TYPE}: ${VALIDATE_LANGUAGE}..."

0 commit comments

Comments
 (0)