diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 4b25ff4434..18407fdcdc 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -92265,17 +92265,6 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: "local" }; } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } let cliVersion2; let tagName; let url2; @@ -92285,9 +92274,18 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian ); toolsInput = await getNightlyToolsUrl(logger); } + const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); if (forceShippedTools) { cliVersion2 = cliVersion; tagName = bundleVersion; + logger.info( + `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` + ); + if (toolsInput === "latest") { + logger.warning( + "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." + ); + } } else if (toolsInput !== void 0) { tagName = tryGetTagNameFromUrl(toolsInput, logger); url2 = toolsInput; diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 27a7a1682d..59fbc30818 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -130208,17 +130208,6 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: "local" }; } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } let cliVersion2; let tagName; let url2; @@ -130228,9 +130217,18 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian ); toolsInput = await getNightlyToolsUrl(logger); } + const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); if (forceShippedTools) { cliVersion2 = cliVersion; tagName = bundleVersion; + logger.info( + `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` + ); + if (toolsInput === "latest") { + logger.warning( + "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." + ); + } } else if (toolsInput !== void 0) { tagName = tryGetTagNameFromUrl(toolsInput, logger); url2 = toolsInput; diff --git a/lib/init-action.js b/lib/init-action.js index 5bd9f385a9..2a06db9678 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -89037,17 +89037,6 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: "local" }; } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } let cliVersion2; let tagName; let url; @@ -89057,9 +89046,18 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian ); toolsInput = await getNightlyToolsUrl(logger); } + const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); if (forceShippedTools) { cliVersion2 = cliVersion; tagName = bundleVersion; + logger.info( + `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` + ); + if (toolsInput === "latest") { + logger.warning( + "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." + ); + } } else if (toolsInput !== void 0) { tagName = tryGetTagNameFromUrl(toolsInput, logger); url = toolsInput; diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 934d9c7e58..00a0c285eb 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -90036,17 +90036,6 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: "local" }; } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } let cliVersion2; let tagName; let url2; @@ -90056,9 +90045,18 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian ); toolsInput = await getNightlyToolsUrl(logger); } + const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); if (forceShippedTools) { cliVersion2 = cliVersion; tagName = bundleVersion; + logger.info( + `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` + ); + if (toolsInput === "latest") { + logger.warning( + "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." + ); + } } else if (toolsInput !== void 0) { tagName = tryGetTagNameFromUrl(toolsInput, logger); url2 = toolsInput; diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 5cc12ec1bf..504d2fba36 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -90737,17 +90737,6 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: "local" }; } - const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.` - ); - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." - ); - } - } let cliVersion2; let tagName; let url2; @@ -90757,9 +90746,18 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian ); toolsInput = await getNightlyToolsUrl(logger); } + const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); if (forceShippedTools) { cliVersion2 = cliVersion; tagName = bundleVersion; + logger.info( + `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion2}, the version shipped with the Action.` + ); + if (toolsInput === "latest") { + logger.warning( + "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required." + ); + } } else if (toolsInput !== void 0) { tagName = tryGetTagNameFromUrl(toolsInput, logger); url2 = toolsInput; diff --git a/src/setup-codeql.ts b/src/setup-codeql.ts index e147a31129..127bb1b930 100644 --- a/src/setup-codeql.ts +++ b/src/setup-codeql.ts @@ -298,31 +298,6 @@ export async function getCodeQLSource( }; } - /** - * Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced. - * - * We use the special value of 'linked' to prioritize the version in `defaults.json` over the - * version specified by the feature flags on Dotcom and over any pinned cached version on - * Enterprise Server. - * - * Previously we have been using 'latest' to force the shipped tools, but this was not clear - * enough for the users, so it has been changed to `linked`. We're keeping around `latest` for - * backwards compatibility. - */ - const forceShippedTools = - toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); - if (forceShippedTools) { - logger.info( - `'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.`, - ); - - if (toolsInput === "latest") { - logger.warning( - "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.", - ); - } - } - /** CLI version number, for example 2.12.6. */ let cliVersion: string | undefined; /** Tag name of the CodeQL bundle, for example `codeql-bundle-20230120`. */ @@ -344,9 +319,33 @@ export async function getCodeQLSource( toolsInput = await getNightlyToolsUrl(logger); } + /** + * Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced. + * + * We use the special value of 'linked' to prioritize the version in `defaults.json` over the + * version specified by the feature flags on Dotcom and over any pinned cached version on + * Enterprise Server. + * + * Previously we have been using 'latest' to force the shipped tools, but this was not clear + * enough for the users, so it has been changed to `linked`. We're keeping around `latest` for + * backwards compatibility. + */ + const forceShippedTools = + toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput); + if (forceShippedTools) { cliVersion = defaults.cliVersion; tagName = defaults.bundleVersion; + + logger.info( + `'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion}, the version shipped with the Action.`, + ); + + if (toolsInput === "latest") { + logger.warning( + "`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.", + ); + } } else if (toolsInput !== undefined) { // If a tools URL was provided, then use that. tagName = tryGetTagNameFromUrl(toolsInput, logger);