Skip to content

Commit 3a2e5fd

Browse files
author
rzuckerm
committed
Try to fix C++ CodeQL status
1 parent 4186c16 commit 3a2e5fd

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,29 @@ jobs:
141141
if: ${{ matrix.build-mode == 'manual' }}
142142
run: python scripts/build_codeql_language.py ${{ matrix.language }} ${{ matrix.paths }}
143143

144-
- name: Perform CodeQL Analysis
144+
- name: Perform CodeQL Analysis With Upload
145+
if: ${{ matrix.language != 'cpp' || github.event_name == 'pull_request' }}
145146
uses: github/codeql-action/analyze@v3
147+
148+
- name: Perform CodeQL Analysis Without Upload
149+
if: ${{ matrix.language == 'cpp' && github.event_name != 'pull_request' }}
150+
uses: github/codeql-action/analyze@v3
151+
with:
152+
upload: false
153+
output: sarif-results
154+
155+
- name: Filter Sarif
156+
if: ${{ matrix.language == 'cpp' && github.event_name != 'pull_request' }}
157+
uses: advanced-security/filter-sarif@v1
158+
with:
159+
patterns: |
160+
+archive/c/c-plus-plus/*.cpp
161+
-archive/h/hack/*.hh
162+
input: sarif-results/${{ matrix.language }}.sarif
163+
output: sarif-results/${{ matrix.language }}.sarif
164+
165+
- name: Upload SARIF
166+
if: ${{ matrix.language == 'cpp' && github.event_name != 'pull_request' }}
167+
uses: github/codeql-action/upload-sarif@v2
168+
with:
169+
sarif_file: sarif-results/${{ matrix.language }}.sarif

0 commit comments

Comments
 (0)