From 8af9639c2228deef01035c004c9ffea6952e3764 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Fri, 8 Sep 2023 13:21:31 +0900 Subject: [PATCH] workaround for #95 v1.28.2 adds the following banner before the json output. ``` ====================================================== tfsec is joining the Trivy family tfsec will continue to remain available for the time being, although our engineering attention will be directed at Trivy going forward. You can read more here: https://github.com/aquasecurity/tfsec/discussions/1994 ====================================================== v1.28.2 ``` this script removes the banner. --- .github/workflows/tests.yml | 5 +++-- script.sh | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f49e726..341cec8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -128,8 +128,9 @@ jobs: test-operating-systems: strategy: - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] + fail-fast: false + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] name: tfsec (${{ matrix.platform }}) runs-on: ${{ matrix.platform }} diff --git a/script.sh b/script.sh index e7639b9..a4ebe3a 100755 --- a/script.sh +++ b/script.sh @@ -70,6 +70,11 @@ echo '::group:: Running tfsec with reviewdog 🐶 ...' # shellcheck disable=SC2086 "${TFSEC_PATH}/tfsec" --format=json ${INPUT_TFSEC_FLAGS:-} . \ + | { + # workaround for #95 + # remove "tfsec is joining the Trivy family" banner + perl -E 'undef $/; my $txt = <>; $txt =~ s/^[^{]*//m; print $txt' + } \ | jq -r -f "${GITHUB_ACTION_PATH}/to-rdjson.jq" \ | "${REVIEWDOG_PATH}/reviewdog" -f=rdjson \ -name="tfsec" \ @@ -79,7 +84,7 @@ echo '::group:: Running tfsec with reviewdog 🐶 ...' -filter-mode="${INPUT_FILTER_MODE}" \ ${INPUT_FLAGS} - tfsec_return="${PIPESTATUS[0]}" reviewdog_return="${PIPESTATUS[2]}" exit_code=$? + tfsec_return="${PIPESTATUS[0]}" reviewdog_return="${PIPESTATUS[3]}" exit_code=$? echo "tfsec-return-code=${tfsec_return}" >> "$GITHUB_OUTPUT" echo "reviewdog-return-code=${reviewdog_return}" >> "$GITHUB_OUTPUT" echo '::endgroup::'