File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7676 with :
7777 args : -fmt sarif -out gosec-results.sarif ./...
7878
79+ - name : Check for Gosec SARIF results
80+ id : check-gosec
81+ run : |
82+ if [ -f gosec-results.sarif ]; then echo "exists=true" >> $GITHUB_OUTPUT; else echo "exists=false" >> $GITHUB_OUTPUT; fi
83+
7984 - name : Upload Gosec results to GitHub Security
80- uses : github/codeql-action/upload-sarif@v3
81- if : always()
85+ uses : github/codeql-action/upload-sarif@v4
86+ if : ${{ always() && (steps.check-gosec.outputs.exists == 'true') }}
8287 with :
8388 sarif_file : gosec-results.sarif
8489
@@ -125,6 +130,7 @@ jobs:
125130 with :
126131 context : .
127132 push : false
133+ load : true
128134 tags : minipaas:${{ github.sha }}
129135 cache-from : type=gha
130136 cache-to : type=gha,mode=max
@@ -137,8 +143,13 @@ jobs:
137143 output : " trivy-results.sarif"
138144 severity : " CRITICAL,HIGH"
139145
146+ - name : Check for Trivy SARIF results
147+ id : check-trivy
148+ run : |
149+ if [ -f trivy-results.sarif ]; then echo "exists=true" >> $GITHUB_OUTPUT; else echo "exists=false" >> $GITHUB_OUTPUT; fi
150+
140151 - name : Upload Trivy scan results
141- uses : github/codeql-action/upload-sarif@v3
142- if : always()
152+ uses : github/codeql-action/upload-sarif@v4
153+ if : ${{ always() && (steps.check-trivy.outputs.exists == 'true') }}
143154 with :
144155 sarif_file : trivy-results.sarif
You can’t perform that action at this time.
0 commit comments