Skip to content

Commit

Permalink
Filter github codeQL scan results to exclude external dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Niethammer <[email protected]>
  • Loading branch information
cniethammer committed Dec 13, 2024
1 parent cbe6a66 commit 09b2e5f
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
include:
- language: c-cpp
- language: cpp
build-mode: manual

steps:
Expand Down Expand Up @@ -63,3 +63,32 @@ jobs:
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
output: sarif-results
upload: failure-only

- name: Upload full loc as a Build Artifact
uses: actions/upload-artifact@v4
with:
name: sarif-results
path: sarif-results
retention-days: 1

- name: Filter CodeQL results
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-external/
input: sarif-results/${{matrix.language}}.sarif
output: sarif-results/${{matrix.language}}.sarif

- name: Upload CodeQL results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/${{matrix.language}}.sarif

- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v4
with:
name: sarif-results
path: sarif-results
retention-days: 1

0 comments on commit 09b2e5f

Please sign in to comment.