Skip to content

CodeQL

CodeQL #4529

name: CodeQL
on:
push:
branches:
- main
- 'support/*'
paths:
- '**'
- '!docs/**'
- '!.github/**'
- .github/workflows/codeql-analysis.yml
pull_request:
branches:
- main
- 'support/*'
paths:
- '**'
- '!docs/**'
- '!.github/**'
- .github/workflows/codeql-analysis.yml
schedule:
- cron: '0 12 * * *'
permissions:
contents: read
env:
DOTNET_ROLL_FORWARD: "Major"
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
jobs:
analyze:
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/analyze to upload SARIF results
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
-
name: Cache cake frosting
id: cache-cake
uses: actions/cache@v4
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
-
name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
-
name: '[Prepare]'
if: steps.cache-cake.outputs.cache-hit != 'true'
run: dotnet build build/CI.sln --configuration=Release
-
name: '[Build]'
shell: pwsh
run: dotnet run/build.dll --target=BuildPrepare --exclusive
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3