Increase strictness of tool caching threshold to avoid caching nightlies
This commit is contained in:
parent
4beb39593b
commit
2014c859f1
3 changed files with 13 additions and 9 deletions
10
lib/setup-codeql.js
generated
10
lib/setup-codeql.js
generated
|
|
@ -428,10 +428,12 @@ async function downloadCodeQL(codeqlURL, maybeCliVersion, apiDetails, variant, t
|
|||
// if the user requests the same URL again, we can get it from the cache without having to call
|
||||
// any of the Releases API.
|
||||
//
|
||||
// Special case: If the CLI version is a pre-release, then cache the bundle as
|
||||
// `0.0.0-<bundleVersion>` to avoid the bundle being interpreted as containing a stable CLI
|
||||
// release.
|
||||
const toolcacheVersion = cliVersion && !cliVersion.includes("-")
|
||||
// Special case: If the CLI version is a pre-release or contains build metadata, then cache the
|
||||
// bundle as `0.0.0-<bundleVersion>` to avoid the bundle being interpreted as containing a stable
|
||||
// CLI release. In principle, it should be enough to just check that the CLI version isn't a
|
||||
// pre-release, but the version numbers of CodeQL nightlies have the format `x.y.z+<timestamp>`,
|
||||
// and we don't want these nightlies to override stable CLI versions in the toolcache.
|
||||
const toolcacheVersion = cliVersion && cliVersion.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)
|
||||
? `${cliVersion}-${bundleVersion}`
|
||||
: convertToSemVer(bundleVersion, logger);
|
||||
return {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -565,11 +565,13 @@ export async function downloadCodeQL(
|
|||
// if the user requests the same URL again, we can get it from the cache without having to call
|
||||
// any of the Releases API.
|
||||
//
|
||||
// Special case: If the CLI version is a pre-release, then cache the bundle as
|
||||
// `0.0.0-<bundleVersion>` to avoid the bundle being interpreted as containing a stable CLI
|
||||
// release.
|
||||
// Special case: If the CLI version is a pre-release or contains build metadata, then cache the
|
||||
// bundle as `0.0.0-<bundleVersion>` to avoid the bundle being interpreted as containing a stable
|
||||
// CLI release. In principle, it should be enough to just check that the CLI version isn't a
|
||||
// pre-release, but the version numbers of CodeQL nightlies have the format `x.y.z+<timestamp>`,
|
||||
// and we don't want these nightlies to override stable CLI versions in the toolcache.
|
||||
const toolcacheVersion =
|
||||
cliVersion && !cliVersion.includes("-")
|
||||
cliVersion && cliVersion.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)
|
||||
? `${cliVersion}-${bundleVersion}`
|
||||
: convertToSemVer(bundleVersion, logger);
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue