File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : build
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+
9
+ jobs :
10
+ Bearer :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Checkout source code
14
+ uses : actions/checkout@v4
15
+ - name : Run Report
16
+ id : report
17
+ uses : bearer/bearer-action@v2
18
+
19
+ Anchore :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : Checkout source code
23
+ uses : actions/checkout@v4
24
+ - name : Scan current project
25
+ uses : anchore/scan-action@v3
26
+ with :
27
+ path : " ."
28
+
29
+ Trivy :
30
+ runs-on : ubuntu-latest
31
+ permissions :
32
+ contents : read
33
+ steps :
34
+ - name : Checkout source code
35
+ uses : actions/checkout@v4
36
+
37
+ # The first call to the action will invoke setup-trivy and install trivy
38
+ - name : Generate Trivy Vulnerability Report
39
+ uses : aquasecurity/trivy-action@master
40
+ with :
41
+ scan-type : " fs"
42
+ output : trivy-report.json
43
+ format : json
44
+ scan-ref : .
45
+ exit-code : 0
46
+
47
+ - name : Upload Vulnerability Scan Results
48
+ uses : actions/upload-artifact@v4
49
+ with :
50
+ name : trivy-report
51
+ path : trivy-report.json
52
+ retention-days : 30
53
+
54
+ - name : Fail build on High/Criticial Vulnerabilities
55
+ uses : aquasecurity/trivy-action@master
56
+ with :
57
+ scan-type : " fs"
58
+ format : table
59
+ scan-ref : .
60
+ severity : HIGH,CRITICAL
61
+ ignore-unfixed : true
62
+ exit-code : 1
63
+ # On a subsequent call to the action we know trivy is already installed so can skip this
64
+ skip-setup-trivy : true
You can’t perform that action at this time.
0 commit comments