Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
Expand All @@ -20,35 +15,56 @@ on:
schedule:
- cron: '34 0 * * 5'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
analyze:
name: Analyze
name: Analyze (${{ matrix.language }}, ${{ matrix.shard }})
runs-on:
group: Large
labels: [ubuntu-latest-x64-16core]

strategy:
fail-fast: false
# C# is split by sample folder so dependency restore and extraction run in parallel.
# Each shard uploads results under its own category.
matrix:
language: [ 'csharp', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
include:
- language: csharp
shard: IdentityServer/v7
- language: csharp
shard: IdentityServer/v8
- language: csharp
shard: BFF
- language: csharp
shard: various
- language: javascript
shard: all

steps:
# C# buildless extraction scans the whole checkout regardless of source-root, so C# shards
# sparse-checkout only their folder (cone mode keeps root files such as global.json and nuget.config).
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: ${{ matrix.shard != 'all' && matrix.shard || '' }}

# Analysis runs without compiling the samples; compilation is verified by the Build workflow.
- name: Initialize CodeQL
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0
with:
languages: ${{ matrix.language }}
build-mode: none
source-root: ${{ matrix.shard == 'all' && '.' || matrix.shard }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0
with:
# JavaScript keeps its pre-sharding default category so existing alerts continue to update.
category: ${{ matrix.language == 'javascript' && '.github/workflows/codeql-analysis.yml:analyze/language:javascript/' || format('/language:{0}/{1}', matrix.language, matrix.shard) }}
Loading