File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1919 description : ' Enable Security Scan'
2020 default : true
2121 type : boolean
22+ security-report :
23+ description : ' Enable Security Report'
24+ default : ' sarif'
25+ type : string
2226 hadolint :
2327 description : ' Enable Hadolint'
2428 default : true
@@ -100,7 +104,7 @@ jobs:
100104
101105 - name : Update Pull Request with Security Scan Results
102106 uses : actions/github-script@v7
103- if : github.event_name == 'pull_request' && inputs.security-scan
107+ if : github.event_name == 'pull_request' && inputs.security-scan && inputs.security-report == 'comment'
104108 with :
105109 script : |
106110 const fs = require('fs');
@@ -123,6 +127,12 @@ jobs:
123127 body: output
124128 });
125129
130+ - name: Upload Trivy scan results to GitHub Security tab
131+ if: github.event_name == 'pull_request' && inputs.security-scan && inputs.security-report == 'sarif'
132+ uses: github/codeql-action/upload-sarif@v3
133+ with:
134+ sarif_file: 'trivy-results.sarif'
135+
126136 - name: Update Pull Request with Hadolint Results
127137 uses: actions/github-script@v7
128138 if: github.event_name == 'pull_request' && inputs.hadolint
You can’t perform that action at this time.
0 commit comments