Skip to content

Commit 019fb43

Browse files
Add CodeQL configuration for security analysis (#1593)
Co-authored-by: Copilot <[email protected]>
1 parent d48e5d1 commit 019fb43

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.github/codeql/codeql-config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: humanizer-codeql
2+
queries:
3+
- uses: security-extended
4+
- uses: security-and-quality
5+
paths:
6+
- src/Humanizer/
7+
paths-ignore:
8+
- src/**/bin/**
9+
- src/**/obj/**

.github/workflows/codeql.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,16 @@ name: "CodeQL Advanced"
1414
on:
1515
push:
1616
branches: [ "main" ]
17+
paths:
18+
- 'src/**'
19+
- '.github/codeql/**'
20+
- '.github/workflows/codeql.yml'
1721
pull_request:
1822
branches: [ "main" ]
23+
paths:
24+
- 'src/**'
25+
- '.github/codeql/**'
26+
- '.github/workflows/codeql.yml'
1927
schedule:
2028
- cron: '41 11 * * 2'
2129

@@ -34,6 +42,7 @@ jobs:
3442
uses: actions/checkout@v4
3543
with:
3644
fetch-depth: 0
45+
fetch-tags: true
3746

3847
# Add any setup steps before running the `github/codeql-action/init` action.
3948
# This includes steps like installing compilers or runtimes (`actions/setup-node`
@@ -49,15 +58,13 @@ jobs:
4958
with:
5059
languages: csharp
5160
build-mode: manual
61+
config-file: .github/codeql/codeql-config.yml
5262

5363
- name: Build
5464
working-directory: src
5565
shell: pwsh
5666
run: |
57-
dotnet --info
58-
dotnet build -c Release --nologo --verbosity minimal
67+
dotnet build Humanizer/Humanizer.csproj -c Release --nologo --verbosity minimal
5968
6069
- name: Perform CodeQL Analysis
6170
uses: github/codeql-action/analyze@v3
62-
with:
63-
category: "/language:csharp"

0 commit comments

Comments
 (0)