-
Notifications
You must be signed in to change notification settings - Fork 50
67 lines (60 loc) · 1.95 KB
/
codeql.yml
File metadata and controls
67 lines (60 loc) · 1.95 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: CodeQL
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "42 4 * * 0"
permissions:
security-events: write
packages: read
actions: read
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- language: actions
category: actions
build-mode: none
- language: javascript-typescript
category: javascript
build-mode: none
- language: csharp
category: csharp
build-mode: manual
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
if: ${{ matrix.language == 'csharp' }}
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: "10.0.x"
- name: Initialize CodeQL
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
config-file: ./.github/linters/.codeql.yml
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Build C# project
if: ${{ matrix.language == 'csharp' }}
run: |
set -euo pipefail
project="reference-architectures/app/api/csharp/microsoft-agent-framework/Caira.Api.MicrosoftAgentFramework.csproj"
dotnet restore "${project}"
dotnet build "${project}" --configuration Release --no-restore
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
category: "/language:${{ matrix.category }}"
upload: ${{ github.event_name == 'merge_group' && 'never' || 'always' }}