-
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 1.76 KB
/
codeql.yml
File metadata and controls
75 lines (63 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# =============================================================================
# Security: CodeQL Analysis
# =============================================================================
# Performs semantic code analysis to find security vulnerabilities and
# code quality issues in C# code.
#
# Triggers:
# - Push to main branch
# - Pull requests to main
# - Weekly schedule (Monday 9 AM UTC)
#
# For more info: https://docs.github.com/en/code-security/code-scanning
# =============================================================================
name: 'Security: CodeQL'
on:
push:
branches:
- main
paths:
- 'src/**/*.cs'
- '**/*.csproj'
- '*.sln'
pull_request:
branches:
- main
paths:
- 'src/**/*.cs'
- '**/*.csproj'
- '*.sln'
schedule:
# Weekly scan on Monday at 9 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch:
jobs:
analyze:
name: Analyze C#
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: csharp
# Config file excludes test code and uses security-and-quality queries
config-file: ./.github/codeql/codeql-config.yml
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.x'
- name: Build solution
run: |
dotnet restore
dotnet build --no-restore --configuration Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:csharp"