Skip to content

Commit

Permalink
workaround for #95
Browse files Browse the repository at this point in the history
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:
aquasecurity/tfsec#1994
======================================================
v1.28.2
```

this script removes the banner.
  • Loading branch information
shogo82148 committed Sep 8, 2023
1 parent cf10e8c commit 8af9639
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
7 changes: 6 additions & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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::'
Expand Down

0 comments on commit 8af9639

Please sign in to comment.