Improve CodeQL workflow with SARIF filtering
Adds SARIF filtering for Go analysis to exclude third-party code from results and updates the workflow to upload filtered SARIF files. This enhances the accuracy of security reports by ignoring irrelevant files.
This commit is contained in:
parent
64191577e4
commit
030bf8a68f
1 changed files with 17 additions and 4 deletions
21
.github/workflows/codeql.yml
vendored
21
.github/workflows/codeql.yml
vendored
|
|
@ -38,12 +38,25 @@ jobs:
|
|||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
queries: security-and-quality
|
||||
config: |
|
||||
paths-ignore:
|
||||
- 'third-party/**'
|
||||
- 'third-party-licenses.*.md'
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{ matrix.language }}"
|
||||
upload: false
|
||||
output: sarif-results
|
||||
|
||||
- name: Filter SARIF for third-party code
|
||||
if: matrix.language == 'go'
|
||||
uses: advanced-security/filter-sarif@bc96d9fb9338c5b48cc440b1b4d0a350b26a20db # v1.0.0
|
||||
with:
|
||||
patterns: |
|
||||
-third-party/**
|
||||
input: sarif-results/${{ matrix.language }}.sarif
|
||||
output: sarif-results/${{ matrix.language }}.sarif
|
||||
|
||||
- name: Upload filtered SARIF
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
sarif_file: sarif-results/${{ matrix.language }}.sarif
|
||||
category: "/language:${{ matrix.language }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue