Compare commits

..
Author SHA1 Message Date
Teppei Fukuda f85b76679f feat: suppress progress bar
Add `--no-progress`
2021-03-11 07:36:44 +02:00
3 changed files with 2 additions and 27 deletions
-2
View File
@@ -136,7 +136,6 @@ Following inputs can be used as `step.with` keys:
| Name | Type | Default | Description | | Name | Type | Default | Description |
|------------------|---------|------------------------------------|-----------------------------------------------| |------------------|---------|------------------------------------|-----------------------------------------------|
| `scan-type` | String | `image` | Scan type, e.g. `image` or `fs`| | `scan-type` | String | `image` | Scan type, e.g. `image` or `fs`|
| `input` | String | | Tar reference, e.g. `alpine-latest.tar` |
| `image-ref` | String | | Image reference, e.g. `alpine:3.10.2` | | `image-ref` | String | | Image reference, e.g. `alpine:3.10.2` |
| `scan-ref` | String | `/github/workspace/` | Scan reference, e.g. `/github/workspace/` or `.`| | `scan-ref` | String | `/github/workspace/` | Scan reference, e.g. `/github/workspace/` or `.`|
| `format` | String | `table` | Output format (`table`, `json`, `template`) | | `format` | String | `table` | Output format (`table`, `json`, `template`) |
@@ -146,7 +145,6 @@ Following inputs can be used as `step.with` keys:
| `ignore-unfixed` | Boolean | false | Ignore unpatched/unfixed vulnerabilities | | `ignore-unfixed` | Boolean | false | Ignore unpatched/unfixed vulnerabilities |
| `vuln-type` | String | `os,library` | Vulnerability types (os,library) | | `vuln-type` | String | `os,library` | Vulnerability types (os,library) |
| `severity` | String | `UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL` | Severities of vulnerabilities to be displayed | | `severity` | String | `UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL` | Severities of vulnerabilities to be displayed |
| `skip-dirs` | String | | Comma separated list of directories where traversal is skipped |
[release]: https://github.com/aquasecurity/trivy-action/releases/latest [release]: https://github.com/aquasecurity/trivy-action/releases/latest
[release-img]: https://img.shields.io/github/release/aquasecurity/trivy-action.svg?logo=github [release-img]: https://img.shields.io/github/release/aquasecurity/trivy-action.svg?logo=github
-10
View File
@@ -9,10 +9,6 @@ inputs:
image-ref: image-ref:
description: 'image reference(for backward compatibility)' description: 'image reference(for backward compatibility)'
required: true required: true
input:
description: 'reference of tar file to scan'
required: false
default: ''
scan-ref: scan-ref:
description: 'Scan reference' description: 'Scan reference'
required: false required: false
@@ -45,10 +41,6 @@ inputs:
description: 'writes results to a file with the specified file name' description: 'writes results to a file with the specified file name'
required: false required: false
default: '' default: ''
skip-dirs:
description: 'comma separated list of directories where traversal is skipped'
required: false
default: ''
runs: runs:
using: 'docker' using: 'docker'
image: "Dockerfile" image: "Dockerfile"
@@ -63,5 +55,3 @@ runs:
- '-h ${{ inputs.output }}' - '-h ${{ inputs.output }}'
- '-i ${{ inputs.image-ref }}' - '-i ${{ inputs.image-ref }}'
- '-j ${{ inputs.scan-ref }}' - '-j ${{ inputs.scan-ref }}'
- '-k ${{ inputs.skip-dirs }}'
- '-l ${{ inputs.input }}'
+2 -15
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -e
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:" o; do while getopts "a:b:c:d:e:f:g:h:i:j:" o; do
case "${o}" in case "${o}" in
a) a)
export scanType=${OPTARG} export scanType=${OPTARG}
@@ -32,12 +32,6 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:" o; do
j) j)
export scanRef=${OPTARG} export scanRef=${OPTARG}
;; ;;
k)
export skipDirs=${OPTARG}
;;
l)
export input=${OPTARG}
;;
esac esac
done done
@@ -46,10 +40,6 @@ export artifactRef="${imageRef}"
if [ "${scanType}" = "fs" ];then if [ "${scanType}" = "fs" ];then
artifactRef=$(echo $scanRef | tr -d '\r') artifactRef=$(echo $scanRef | tr -d '\r')
fi fi
input=$(echo $input | tr -d '\r')
if [ $input ]; then
artifactRef="--input $input"
fi
ignoreUnfixed=$(echo $ignoreUnfixed | tr -d '\r') ignoreUnfixed=$(echo $ignoreUnfixed | tr -d '\r')
ARGS="" ARGS=""
@@ -74,9 +64,6 @@ fi
if [ $output ];then if [ $output ];then
ARGS="$ARGS --output $output" ARGS="$ARGS --output $output"
fi fi
if [ $skipDirs ];then
ARGS="$ARGS --skip-dirs $skipDirs"
fi
echo "Running trivy with options: " --no-progress "${ARGS}" "${artifactRef}" echo "Running trivy with options: " "${ARGS}" "${artifactRef}"
trivy ${scanType} --no-progress $ARGS ${artifactRef} trivy ${scanType} --no-progress $ARGS ${artifactRef}