@@ -437,9 +437,9 @@ async function getCacheKeyPrefixBase(
437437
438438/**
439439 * Searches the GitHub Actions cache for overlay-base databases matching the given languages, and
440- * returns all CodeQL versions found across matching cache entries.
440+ * returns all stable CodeQL versions found across matching cache entries.
441441 *
442- * @returns Unique CodeQL versions found in cached overlay-base databases, sorted from latest to
442+ * @returns Unique stable CodeQL versions found in cached overlay-base databases, sorted from latest to
443443 * earliest, or undefined if one of the languages is not a built-in language.
444444 */
445445export async function getCodeQlVersionsForOverlayBaseDatabases (
@@ -475,9 +475,14 @@ export async function getCodeQlVersionsForOverlayBaseDatabases(
475475 `${ caches . length === 1 ? "database" : "databases" } in the Actions cache.` ,
476476 ) ;
477477
478- // Parse CodeQL versions from cache keys.
479- // After the prefix, the remaining key format starts with
480- // `${codeQlVersion}-`.
478+ // Parse CodeQL versions from cache keys, matching only stable releases.
479+ //
480+ // After the prefix, the remaining key format starts with `${codeQlVersion}-`. Nightlies will have
481+ // a suffix like `+202604201548` that will break the match.
482+ //
483+ // Caveat: this relies on the fact that we haven't released any CodeQL bundles with the
484+ // `x.y.z-<pre-release>` semver format which does not interact well with the current overlay base
485+ // DB cache key format.
481486 const versionRegex = / ^ ( [ \d . ] + ) - / ;
482487 const versionSet = new Set < string > ( ) ;
483488
0 commit comments