File tree Expand file tree Collapse file tree 1 file changed +5
-35
lines changed Expand file tree Collapse file tree 1 file changed +5
-35
lines changed Original file line number Diff line number Diff line change 48
48
with :
49
49
fetch-depth : 0
50
50
51
- - name : Setup oras
52
- run : |
53
- VERSION="1.2.0"
54
- curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
55
- mkdir -p oras-install/
56
- tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
57
- sudo mv oras-install/oras /usr/local/bin/
58
- rm -rf oras_${VERSION}_*.tar.gz oras-install/
59
-
60
- - name : Get current date
61
- id : date
62
- run : echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
63
-
64
- - name : Download and extract the vulnerability DB
65
- run : |
66
- mkdir -p $GITHUB_WORKSPACE/.cache/trivy/db
67
- oras pull ghcr.io/aquasecurity/trivy-db:2
68
- tar -xzf db.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/db
69
- rm db.tar.gz
70
-
71
- - name : Download and extract the Java DB
72
- run : |
73
- mkdir -p $GITHUB_WORKSPACE/.cache/trivy/java-db
74
- oras pull ghcr.io/aquasecurity/trivy-java-db:1
75
- tar -xzf javadb.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/java-db
76
- rm javadb.tar.gz
77
-
78
- - name : Trivy Scan
79
- shell : bash
80
- run : |
81
- DIR=`mktemp -d`
82
- curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b ${DIR} v0.51.2
83
- echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
84
- export TRIVY_CACHE=$GITHUB_WORKSPACE/.cache/trivy
85
- ${DIR}/trivy fs --cache-dir ${TRIVY_CACHE} --exit-code 1 .
51
+ - name : Run Trivy vulnerability scanner to scan repo
52
+ uses : aquasecurity/trivy-action@0.29.0
53
+ with :
54
+ scan-type : ' fs'
55
+ exit-code : 1
You can’t perform that action at this time.
0 commit comments