From a14ca603518de27c14f77020d4743179bd5511ed Mon Sep 17 00:00:00 2001 From: Damian Hickey Date: Tue, 27 Oct 2026 09:12:52 +0100 Subject: [PATCH] Fix repository-relative paths in CodeQL C# shards Keep the source root at the repository root while retaining per-shard sparse checkout and existing analysis categories. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3d488ddb..d741d6f6 100755 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,8 +44,8 @@ jobs: 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). + # Sparse-checkout limits C# buildless extraction to each shard's folder. + # Cone mode keeps root files such as global.json and nuget.config. - name: Checkout repository uses: actions/checkout@v4 with: @@ -57,7 +57,8 @@ jobs: with: languages: ${{ matrix.language }} build-mode: none - source-root: ${{ matrix.shard == 'all' && '.' || matrix.shard }} + # Keep alert paths repository-relative; sparse-checkout controls the extraction scope. + source-root: . # 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.