56
56
matrix :
57
57
versions : ${{ fromJSON(needs.version.outputs.versions) }}
58
58
steps :
59
+ - name : Checkout code
60
+ uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
61
+
59
62
- shell : bash
60
63
id : test
61
64
run : echo "Scanning registry.k8s.io/ingress-nginx/controller@${{ matrix.versions }}"
@@ -66,29 +69,27 @@ jobs:
66
69
with :
67
70
image-ref : registry.k8s.io/ingress-nginx/controller:${{ matrix.versions }}
68
71
format : ' sarif'
69
- output : trivy-results-${{ matrix.versions }}.sarif
72
+ output : ${{ github.workspace }}/ trivy-results-${{ matrix.versions }}.sarif
70
73
exit-code : 0
71
74
vuln-type : ' os,library'
72
75
severity : ' CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
73
76
74
77
- name : Output Sarif File
75
78
shell : bash
76
- run : cat trivy-results-${{ matrix.versions }}.sarif
77
-
78
- - name : Checkout code
79
- uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
79
+ run : cat ${{ github.workspace }}/trivy-results-${{ matrix.versions }}.sarif
80
80
81
81
# This step checks out a copy of your repository.
82
82
- name : Upload SARIF file
83
83
uses : github/codeql-action/upload-sarif@0c670bbf0414f39666df6ce8e718ec5662c21e03
84
84
with :
85
+ token : ${{ github.token }}
85
86
# Path to SARIF file relative to the root of the repository
86
- sarif_file : trivy-results-${{ matrix.versions }}.sarif
87
+ sarif_file : ${{ github.workspace }}/ trivy-results-${{ matrix.versions }}.sarif
87
88
88
89
- name : Vulz Count
89
90
shell : bash
90
91
run : |
91
- TRIVY_COUNT=$(cat trivy-results-${{ matrix.versions }}.sarif | jq '.runs[0].results | length')
92
+ TRIVY_COUNT=$(cat ${{ github.workspace }}/ trivy-results-${{ matrix.versions }}.sarif | jq '.runs[0].results | length')
92
93
echo "TRIVY_COUNT: $TRIVY_COUNT"
93
94
echo "Image Vulnerability scan output" >> $GITHUB_STEP_SUMMARY
94
95
echo "Image ID: registry.k8s.io/ingress-nginx/controller@${{ matrix.versions }}" >> $GITHUB_STEP_SUMMARY
0 commit comments