File tree 3 files changed +49
-11
lines changed
3 files changed +49
-11
lines changed Original file line number Diff line number Diff line change 31
31
32
32
- name : Install dependencies
33
33
run : |
34
- sudo snap install docker
35
- sudo addgroup --system docker; sudo adduser $USER docker
36
- newgrp docker
37
- sudo snap disable docker; sudo snap enable docker
38
-
39
34
sudo snap install yq
40
35
sudo snap install rockcraft --classic --edge
41
36
sudo snap install --devmode --channel edge skopeo
Original file line number Diff line number Diff line change 52
52
uses : actions/checkout@v3
53
53
54
54
- name : Install dependencies
55
- run : |
56
- sudo snap install docker
57
- sudo addgroup --system docker; sudo adduser $USER docker
58
- newgrp docker
59
- sudo snap disable docker; sudo snap enable docker
60
-
55
+ run : |
61
56
sudo snap install yq
62
57
63
58
- name : Login to GitHub Container Registry
Original file line number Diff line number Diff line change
1
+ name : trivy
2
+ on :
3
+ pull_request :
4
+
5
+ jobs :
6
+ build :
7
+ uses : ./.github/workflows/build.yaml
8
+ scan :
9
+ name : Trivy scan
10
+ needs : build
11
+ runs-on : ubuntu-20.04
12
+ steps :
13
+ - name : Checkout code
14
+ uses : actions/checkout@v3
15
+ - name : Install skopeo
16
+ run : |
17
+ sudo snap install --devmode --channel edge skopeo
18
+ - name : Get Artifact Name
19
+ id : artifact
20
+ run : |
21
+ ARTIFACT=$(make help | grep 'Artifact: ')
22
+ echo "name=${ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
23
+ - name : Download artifact
24
+ uses : actions/download-artifact@v3
25
+ with :
26
+ name : charmed-spark
27
+ path : charmed-spark
28
+ - name : Import locally
29
+ run : |
30
+ # Unpack artifact
31
+ mv charmed-spark/${{ steps.artifact.outputs.name }} .
32
+ rmdir charmed-spark
33
+ sudo skopeo --insecure-policy copy \
34
+ docker-archive:${{ steps.artifact.outputs.name }} \
35
+ docker-daemon:trivy/charmed-spark:test
36
+ - name : Run Trivy vulnerability scanner
37
+ uses : aquasecurity/trivy-action@master
38
+ with :
39
+ image-ref : ' trivy/charmed-spark:test'
40
+ format : ' sarif'
41
+ output : ' trivy-results.sarif'
42
+ severity : ' MEDIUM,HIGH,CRITICAL'
43
+
44
+ - name : Upload Trivy scan results to GitHub Security tab
45
+ uses : github/codeql-action/upload-sarif@v2
46
+ if : always()
47
+ with :
48
+ sarif_file : ' trivy-results.sarif'
You can’t perform that action at this time.
0 commit comments