File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060
6161permissions :
6262 contents : read
63+ security-events : write
6364
6465env :
6566 FULL_IMAGE : ${{ inputs.registry-host }}/${{ inputs.image-path }}/${{ inputs.component }}
@@ -149,3 +150,19 @@ jobs:
149150 DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' "${{ env.FULL_IMAGE }}:${{ steps.meta.outputs.tag }}" 2>/dev/null | cut -d@ -f2 || echo "")
150151 echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT"
151152 echo "Pushed: ${{ env.FULL_IMAGE }}:${{ steps.meta.outputs.tag }}"
153+
154+ # --- Trivy vulnerability scan ---
155+ - name : Run Trivy vulnerability scanner
156+ uses : aquasecurity/trivy-action@a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 # v0.36.0
157+ with :
158+ image-ref : " ${{ env.FULL_IMAGE }}:${{ steps.meta.outputs.tag }}"
159+ format : " sarif"
160+ output : " trivy-results.sarif"
161+ severity : " HIGH,CRITICAL"
162+ exit-code : " 0"
163+
164+ - name : Upload Trivy scan results to GitHub Security tab
165+ uses : github/codeql-action/upload-sarif@b0c4fd77f6c559021d78430ec4d0d169ae74a4eb # v3
166+ with :
167+ sarif_file : " trivy-results.sarif"
168+ if : always()
You can’t perform that action at this time.
0 commit comments