From 2bc06587aa5aeb8171e05d6ead4e35b37413104f Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 11 Mar 2026 17:10:45 +0000 Subject: [PATCH] PR checks: Add support for per-OS CodeQL version --- pr-checks/sync.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pr-checks/sync.ts b/pr-checks/sync.ts index e6ccac629..5044f4b85 100755 --- a/pr-checks/sync.ts +++ b/pr-checks/sync.ts @@ -38,6 +38,8 @@ interface Specification extends JobSpecification { versions?: string[]; /** Operating system prefixes used to select runner images (e.g. `["ubuntu", "macos"]`). */ operatingSystems?: string[]; + /** Per-OS version overrides. If specified for an OS, only those versions are tested on that OS. */ + osCodeQlVersions?: Record; /** Whether to use the all-platform CodeQL bundle. */ useAllPlatformBundle?: string; /** Values for the `analysis-kinds` matrix dimension. */ @@ -317,6 +319,13 @@ function generateJobMatrix( const operatingSystems = checkSpecification.operatingSystems ?? ["ubuntu"]; for (const operatingSystem of operatingSystems) { + // If osCodeQlVersions is set for this OS, only include the specified CodeQL versions. + const allowedVersions = + checkSpecification.osCodeQlVersions?.[operatingSystem]; + if (allowedVersions && !allowedVersions.includes(version)) { + continue; + } + const runnerImagesForOs = runnerImages.filter((image) => image.startsWith(operatingSystem), );