-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.86 KB
/
Copy pathcodeql.yml
File metadata and controls
59 lines (50 loc) · 1.86 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
name: CodeQL
# Static analysis for the C# surface of this repo — runs on every push/PR to
# master plus a weekly schedule, so newly-added CodeQL query patterns get a
# chance to flag existing code, not just new diffs.
#
# Scoped to net10.0 on ubuntu-latest via CI_TFMS (the same mechanism
# ci.yml's ubuntu leg uses): CodeQL needs one successful build to extract
# from, and the platform TFMs (ios/android/macos/browser) need workloads
# and runners this leg doesn't have — build-platform-tfms.yml and
# release.yml already compile-check those separately.
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '24 3 * * 1' # weekly, Monday 03:24 UTC
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze (C#)
runs-on: ubuntu-latest
timeout-minutes: 20
# Job-level permissions replace (not merge with) any workflow-level
# block, so both grants live here even though only one job exists —
# scoping them to the job that actually needs them, not the workflow.
permissions:
contents: read
security-events: write
env:
CI_TFMS: net10.0
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- name: Setup .NET
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5
- name: Initialize CodeQL
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
with:
languages: csharp
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build TopSecret.ProtectedString.sln --configuration Release --no-restore
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4