Skip to content

Commit ba52d10

Browse files
authored
Update codeql.yml
Update CodeQL to exclude .g.cs files
1 parent 8e7ae98 commit ba52d10

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/codeql.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919

2020
strategy:
2121
fail-fast: false
22-
matrix:
23-
language: [ csharp ]
2422

2523
steps:
2624
- name: Checkout
@@ -29,13 +27,29 @@ jobs:
2927
- name: Initialize CodeQL
3028
uses: github/codeql-action/init@v3
3129
with:
32-
languages: ${{ matrix.language }}
30+
languages: csharp
3331
queries: +security-and-quality
3432

35-
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v3
33+
- name: Build
34+
run: dotnet build -c Debug
3735

3836
- name: Perform CodeQL Analysis
3937
uses: github/codeql-action/analyze@v3
4038
with:
41-
category: "/language:${{ matrix.language }}"
39+
category: "/language:csharp"
40+
upload: False
41+
output: sarif-results
42+
43+
- name: filter-sarif
44+
uses: advanced-security/filter-sarif@v1
45+
with:
46+
patterns: |
47+
+**/*
48+
-**/*.g.cs
49+
input: sarif-results/csharp.sarif
50+
output: sarif-results/csharp.sarif
51+
52+
- name: Upload SARIF
53+
uses: github/codeql-action/upload-sarif@v3
54+
with:
55+
sarif_file: sarif-results/csharp.sarif

0 commit comments

Comments
 (0)