Skip to content

Commit ff58c43

Browse files
farodin91porunov
authored andcommitted
add trivy scan to docker
Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
1 parent 27e515c commit ff58c43

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/ci-release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ jobs:
6868
include:
6969
- args: ""
7070
java: 8
71+
tag_suffix: ""
7172
- args: "-Pjava-11"
7273
java: 11
74+
tag_suffix: "-java-11"
7375
steps:
7476
- uses: actions/checkout@v4
7577
- uses: actions/cache@v3
@@ -95,6 +97,22 @@ jobs:
9597
with:
9698
name: distribution-builds
9799
path: janusgraph-dist/target/janusgraph-*.zip
100+
- name: Set JanusGraph version environment variable
101+
run: |
102+
export JG_VER="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$(git rev-parse --short HEAD)"
103+
echo "JG_VER=${JG_VER}" >> $GITHUB_ENV
104+
- name: Run Trivy vulnerability scanner
105+
if: github.repository == 'janusgraph/janusgraph'
106+
uses: aquasecurity/trivy-action@0.12.0
107+
with:
108+
image-ref: 'ghcr.io/janusgraph/janusgraph:${{ env.JG_VER }}${{ matrix.tag_suffix }}'
109+
format: 'sarif'
110+
output: 'trivy-results.sarif'
111+
- name: Upload Trivy scan results to GitHub Security tab
112+
if: github.repository == 'janusgraph/janusgraph'
113+
uses: github/codeql-action/upload-sarif@v2
114+
with:
115+
sarif_file: 'trivy-results.sarif'
98116

99117
tp-tests:
100118
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)