Skip to content

CodeQL

CodeQL #27

Workflow file for this run

name: CodeQL
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
types: [ opened, synchronize, reopened, ready_for_review ]
schedule:
- cron: '0 6 * * 1'
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
jobs:
changes:
name: Detect changed paths
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest
outputs:
csharp: ${{ github.event_name != 'pull_request' || steps.filter.outputs.csharp == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Filter
id: filter
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@v4
with:
filters: |
csharp:
- 'src/**'
- 'tests/**'
- 'benchmarks/**'
- 'Directory.Build.props'
- 'global.json'
- '.github/workflows/codeql.yml'
analyze:
name: Analyze (csharp)
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.csharp == 'true'
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/*.csproj'
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: csharp
queries: security-extended
- name: Build (Release)
run: dotnet build QueryCache.slnx --configuration Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:csharp"