From 1aade295bc05b887c74db29238a4a6a6830afabd Mon Sep 17 00:00:00 2001 From: Mario Campos Date: Tue, 4 Nov 2025 09:59:16 -0600 Subject: [PATCH] Update deprecation warnings for CodeQL Action to v4 --- lib/analyze-action.js | 6 +++--- lib/autobuild-action.js | 6 +++--- lib/init-action.js | 6 +++--- lib/resolve-environment-action.js | 6 +++--- lib/setup-codeql-action.js | 6 +++--- lib/upload-sarif-action.js | 6 +++--- src/util.ts | 24 ++++++++++++------------ 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 1751b0335..9e0d30df7 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -87413,14 +87413,14 @@ async function checkDiskUsage(logger) { } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 !process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) { if (githubVersion.type === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11" + ">=3.20" )) { core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + "CodeQL Action major versions v1, v2, and v3 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 58190c45d..b32b9311a 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -83157,14 +83157,14 @@ async function checkDiskUsage(logger) { } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 !process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) { if (githubVersion.type === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11" + ">=3.20" )) { core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + "CodeQL Action major versions v1, v2, and v3 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } diff --git a/lib/init-action.js b/lib/init-action.js index a3b4cf1f5..7cff5a38d 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -84734,14 +84734,14 @@ async function checkDiskUsage(logger) { } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 !process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) { if (githubVersion.type === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11" + ">=3.20" )) { core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + "CodeQL Action major versions v1, v2, and v3 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 026a62424..3c5558a6c 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -83169,14 +83169,14 @@ async function checkDiskUsage(logger) { } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 !process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) { if (githubVersion.type === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11" + ">=3.20" )) { core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + "CodeQL Action major versions v1, v2, and v3 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 265caf361..c22940852 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -83245,14 +83245,14 @@ async function checkDiskUsage(logger) { } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 !process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) { if (githubVersion.type === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11" + ">=3.20" )) { core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + "CodeQL Action major versions v1, v2, and v3 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index db4a464eb..d0e2be8cc 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -86065,14 +86065,14 @@ async function checkDiskUsage(logger) { } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 !process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) { if (githubVersion.type === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11" + ">=3.20" )) { core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + "CodeQL Action major versions v1, v2, and v3 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } diff --git a/src/util.ts b/src/util.ts index 96ea0f9da..7f58c1860 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1114,38 +1114,38 @@ export async function checkDiskUsage( } /** - * Prompt the customer to upgrade to CodeQL Action v3, if appropriate. + * Prompt the customer to upgrade to CodeQL Action v4, if appropriate. * - * Check whether a customer is running v1 or v2. If they are, and we can determine that the GitHub - * instance supports v3, then log an error prompting the customer to upgrade to v3. + * Check whether a customer is running v1, v2, or v3. If they are, and we can determine that the GitHub + * instance supports v4, then log an error prompting the customer to upgrade to v4. */ export function checkActionVersion( version: string, githubVersion: GitHubVersion, ) { if ( - !semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + !semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4 !process.env[EnvVar.LOG_VERSION_DEPRECATION] // do not log error if we have already ) { - // Only error for versions of GHES that are compatible with CodeQL Action version 3. + // Only error for versions of GHES that are compatible with CodeQL Action version 4. // - // GHES 3.11 shipped without the v3 tag, but it also shipped without this warning message code. - // Therefore users who are seeing this warning message code have pulled in a new version of the - // Action, and with it the v3 tag. + // GHES 3.19 shipped without the v4 tag, but it also shipped without this warning message code. + // Therefore, users who are seeing this warning message code have pulled in a new version of the + // Action, and with it the v4 tag. if ( githubVersion.type === GitHubVariant.DOTCOM || githubVersion.type === GitHubVariant.GHE_DOTCOM || (githubVersion.type === GitHubVariant.GHES && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11", + ">=3.20", )) ) { core.error( - "CodeQL Action major versions v1 and v2 have been deprecated. " + - "Please update all occurrences of the CodeQL Action in your workflow files to v3. " + + "CodeQL Action major versions v1, v2, and v3 have been deprecated. " + + "Please update all occurrences of the CodeQL Action in your workflow files to v4. " + "For more information, see " + - "https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/", + "https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/", ); // set LOG_VERSION_DEPRECATION env var to prevent the warning from being logged multiple times core.exportVariable(EnvVar.LOG_VERSION_DEPRECATION, "true");