Skip to content

Commit 2bc0658

Browse files
committed
PR checks: Add support for per-OS CodeQL version
1 parent 1a97b0f commit 2bc0658

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pr-checks/sync.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ interface Specification extends JobSpecification {
3838
versions?: string[];
3939
/** Operating system prefixes used to select runner images (e.g. `["ubuntu", "macos"]`). */
4040
operatingSystems?: string[];
41+
/** Per-OS version overrides. If specified for an OS, only those versions are tested on that OS. */
42+
osCodeQlVersions?: Record<string, string[]>;
4143
/** Whether to use the all-platform CodeQL bundle. */
4244
useAllPlatformBundle?: string;
4345
/** Values for the `analysis-kinds` matrix dimension. */
@@ -317,6 +319,13 @@ function generateJobMatrix(
317319
const operatingSystems = checkSpecification.operatingSystems ?? ["ubuntu"];
318320

319321
for (const operatingSystem of operatingSystems) {
322+
// If osCodeQlVersions is set for this OS, only include the specified CodeQL versions.
323+
const allowedVersions =
324+
checkSpecification.osCodeQlVersions?.[operatingSystem];
325+
if (allowedVersions && !allowedVersions.includes(version)) {
326+
continue;
327+
}
328+
320329
const runnerImagesForOs = runnerImages.filter((image) =>
321330
image.startsWith(operatingSystem),
322331
);

0 commit comments

Comments
 (0)