diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43a38e4c..fc1ead84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,7 +102,7 @@ jobs: ${{ env.CONTAINER_IMAGE_ID }} target: "${{ matrix.images.target }}" - - name: Test Local Action + - name: Test Local Action (debug log) uses: ./ env: ACTIONS_RUNNER_DEBUG: true @@ -120,6 +120,16 @@ jobs: sudo cat super-linter.log sudo rm -v super-linter.log + - name: Test Local Action (default log) + uses: ./ + env: + VALIDATE_ALL_CODEBASE: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BRANCH: main + GITLEAKS_CONFIG_FILE: .gitleaks-ignore-tests.toml + FILTER_REGEX_EXCLUDE: ".*(/test/linters/|CHANGELOG.md).*" + TYPESCRIPT_STANDARD_TSCONFIG_FILE: ".github/linters/tsconfig.json" + - name: Run Test Suite run: make test diff --git a/lib/functions/buildFileList.sh b/lib/functions/buildFileList.sh index b1312791..12765e3e 100755 --- a/lib/functions/buildFileList.sh +++ b/lib/functions/buildFileList.sh @@ -157,7 +157,7 @@ function BuildFileList() { local STDOUT_BUILD_FILE_LIST # Get raw output so we can strip quotes from the data we load - if ! STDOUT_BUILD_FILE_LIST="$(jq --raw-output '.[].Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then + if ! STDOUT_BUILD_FILE_LIST="$(jq --raw-output '.[] | select(.Stdout[:-1] | length > 0) | .Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then fatal "Error when loading stdout when building the file list: ${STDOUT_BUILD_FILE_LIST}" fi @@ -168,7 +168,7 @@ function BuildFileList() { fi local STDERR_BUILD_FILE_LIST - if ! STDERR_BUILD_FILE_LIST="$(jq --raw-output '.[].Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then + if ! STDERR_BUILD_FILE_LIST="$(jq --raw-output '.[] | select(.Stderr[:-1] | length > 0) | .Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then fatal "Error when loading stderr when building the file list:\n${STDERR_BUILD_FILE_LIST}" fi diff --git a/lib/functions/worker.sh b/lib/functions/worker.sh index 66c5a126..9527155d 100755 --- a/lib/functions/worker.sh +++ b/lib/functions/worker.sh @@ -188,7 +188,7 @@ function LintCodebase() { local STDOUT_LINTER # Get raw output so we can strip quotes from the data we load. Also, strip the final newline to avoid adding it two times - if ! STDOUT_LINTER="$(jq --raw-output '.[].Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then + if ! STDOUT_LINTER="$(jq --raw-output '.[] | select(.Stdout[:-1] | length > 0) | .Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then fatal "Error when loading stdout for ${FILE_TYPE}:\n${STDOUT_LINTER}" fi @@ -199,7 +199,7 @@ function LintCodebase() { fi local STDERR_LINTER - if ! STDERR_LINTER="$(jq --raw-output '.[].Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then + if ! STDERR_LINTER="$(jq --raw-output '.[] | select(.Stderr[:-1] | length > 0) | .Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then fatal "Error when loading stderr for ${FILE_TYPE}:\n${STDERR_LINTER}" fi diff --git a/lib/linter.sh b/lib/linter.sh index d778525b..ff6cdd31 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -830,7 +830,7 @@ fi debug "RESULTS_OBJECT when running linters:\n${RESULTS_OBJECT}" # Get raw output so we can strip quotes from the data we load. Also, strip the final newline to avoid adding it two times -if ! STDOUT_LINTERS="$(jq --raw-output '.[].Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then +if ! STDOUT_LINTERS="$(jq --raw-output '.[] | select(.Stdout[:-1] | length > 0) | .Stdout[:-1]' <<<"${RESULTS_OBJECT}")"; then fatal "Error when loading stdout when running linters:\n${STDOUT_LINTERS}" fi @@ -840,7 +840,7 @@ else debug "Stdout when running linters is empty" fi -if ! STDERR_LINTERS="$(jq --raw-output '.[].Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then +if ! STDERR_LINTERS="$(jq --raw-output '.[] | select(.Stderr[:-1] | length > 0) | .Stderr[:-1]' <<<"${RESULTS_OBJECT}")"; then fatal "Error when loading stderr for ${FILE_TYPE}:\n${STDERR_LINTERS}" fi