Skip to content

Commit 437bcfb

Browse files
committed
test: add tirvy vulnerability scanner github action
1 parent 698cf61 commit 437bcfb

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/trivy.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Trivy vulnerability scanner
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Install go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: ^1.16
19+
20+
- name: Build an image from Dockerfile
21+
run: |
22+
make
23+
docker build -t test/livenessprobe:latest -f Dockerfile --output=type=docker --label revision=latest .
24+
25+
- name: Run Trivy vulnerability scanner
26+
uses: aquasecurity/trivy-action@master
27+
with:
28+
image-ref: 'test/livenessprobe:latest'
29+
format: 'table'
30+
exit-code: '1'
31+
ignore-unfixed: true
32+
vuln-type: 'os,library'
33+
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'

0 commit comments

Comments
 (0)