Skip to content

Commit

Permalink
ci/codeql: use filter-sarif to filter meson-private
Browse files Browse the repository at this point in the history
There is a severe number of false-positive in code scanning caused by
inspecting meson-internal test files like
'build/meson-private/tmpzb46osmq/testfile.c'.

As a workaround, use the 'filter-sarif' action to filter out these
results before uploading the SARIF (Static Analysis Results Interchange
Format).

This PR was inspired by rauc/rauc#1346 and the
example from https://github.com/advanced-security/filter-sarif.

Signed-off-by: Enrico Joerns <[email protected]>
[Emil: port from rauc, use checksums for actions]
Signed-off-by: Emil Velikov <[email protected]>
Link: #249
Signed-off-by: Lucas De Marchi <[email protected]>
  • Loading branch information
ejoerns authored and lucasdemarchi committed Nov 19, 2024
1 parent 9cbb979 commit 4b5d968
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,19 @@ jobs:
uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
with:
category: "/language:cpp"
upload: false
output: sarif-results

- name: Filter out meson-internal test files
uses: advanced-security/filter-sarif@f3b8118a9349d88f7b1c0c488476411145b6270d # v1.0.1
with:
patterns: |
-build/meson-private/**/testfile.c
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif

- name: Upload CodeQL results to code scanning
uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
with:
sarif_file: sarif-results/cpp.sarif
category: "/language:cpp"

0 comments on commit 4b5d968

Please sign in to comment.