Skip to content

Commit

Permalink
trivy-iac-scan: Fix bug with empty URI (#155)
Browse files Browse the repository at this point in the history
* trivy-iac-scan: Fix bug with empty URI

* Update action.yml

* Update action.yml
  • Loading branch information
OysteinThuen authored Nov 13, 2024
1 parent bd6b388 commit 98c757f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion trivy-iac-scan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,15 @@ runs:
--ignorefile '${{ inputs.trivyignore }}' \
${{ inputs.skip-dirs != '' && format('--skip-dirs {0}', inputs.skip-dirs) || '' }}
- name: Modify Trivy report
shell: bash
run: |
# Run jq to modify the Trivy report
cat ${{ env.TRIVY_SARIF }} |jq '.runs[0].results[] |= (select(.locations[].physicalLocation.artifactLocation.uri=="").locations[].physicalLocation.artifactLocation.uri=".")'>trivy2.sarif
- name: Upload Trivy report to GitHub Security tab
if: ${{ inputs.upload-report == 'true' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ env.TRIVY_SARIF }}
sarif_file: trivy2.sarif
category: 'Trivy'

0 comments on commit 98c757f

Please sign in to comment.