Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add show-suppressed as an input #376

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ inputs:
docker-host:
description: 'unix domain socket path to use for docker scanning, ex. unix:///var/run/docker.sock'
required: false
show-suppressed:
description: 'show the suppressed results'
required: false
default: 'false'


runs:
using: 'docker'
Expand Down Expand Up @@ -124,6 +129,7 @@ runs:
- '-t ${{ inputs.trivyignores }}'
- '-u ${{ inputs.github-pat }}'
- '-v ${{ inputs.trivy-config }}'
- '-w ${{ inputs.show-suppressed }}'
- '-x ${{ inputs.tf-vars }}'
- '-z ${{ inputs.limit-severities-for-sarif }}'
- '-y ${{ inputs.docker-host }}'
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:" o; do
case "${o}" in
a)
export scanType=${OPTARG}
Expand Down Expand Up @@ -68,6 +68,9 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do
v)
export trivyConfig=${OPTARG}
;;
w)
export showSuppressed=${OPTARG}
;;
x)
export tfVars=${OPTARG}
;;
Expand All @@ -94,6 +97,7 @@ fi
ignoreUnfixed=$(echo $ignoreUnfixed | tr -d '\r')
hideProgress=$(echo $hideProgress | tr -d '\r')
limitSeveritiesForSARIF=$(echo $limitSeveritiesForSARIF | tr -d '\r')
showSuppressed=$(echo $showSuppressed | tr -d '\r')

GLOBAL_ARGS=""
if [ $cacheDir ];then
Expand Down Expand Up @@ -141,6 +145,9 @@ fi
if [ $tfVars ] && [ "$scanType" == "config" ];then
ARGS="$ARGS --tf-vars $tfVars"
fi
if [ "$showSuppressed" == "true" ];then
ARGS="$ARGS --show-suppressed"
fi

if [ $trivyIgnores ];then
for f in $(echo $trivyIgnores | tr "," "\n")
Expand Down