Skip to content

Commit 320a6b6

Browse files
authored
Merge pull request #3272 from github/mario-campos/v4-warning
Update deprecation warnings for CodeQL Action to v4
2 parents e2ef519 + b5e5a25 commit 320a6b6

File tree

9 files changed

+44
-38
lines changed

9 files changed

+44
-38
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7-
No user facing changes.
7+
- CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/).
88

99
## 4.31.2 - 30 Oct 2025
1010

lib/analyze-action.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment-action.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql-action.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/util.test.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,21 @@ const CHECK_ACTION_VERSION_TESTS: Array<[string, util.GitHubVersion, boolean]> =
447447
["2.2.1", { type: util.GitHubVariant.DOTCOM }, true],
448448
["2.2.1", { type: util.GitHubVariant.GHE_DOTCOM }, true],
449449
["2.2.1", { type: util.GitHubVariant.GHES, version: "3.10" }, false],
450-
["2.2.1", { type: util.GitHubVariant.GHES, version: "3.11" }, true],
451-
["2.2.1", { type: util.GitHubVariant.GHES, version: "3.12" }, true],
452-
["3.2.1", { type: util.GitHubVariant.DOTCOM }, false],
453-
["3.2.1", { type: util.GitHubVariant.GHE_DOTCOM }, false],
450+
["2.2.1", { type: util.GitHubVariant.GHES, version: "3.11" }, false],
451+
["2.2.1", { type: util.GitHubVariant.GHES, version: "3.12" }, false],
452+
["3.2.1", { type: util.GitHubVariant.DOTCOM }, true],
453+
["3.2.1", { type: util.GitHubVariant.GHE_DOTCOM }, true],
454454
["3.2.1", { type: util.GitHubVariant.GHES, version: "3.10" }, false],
455455
["3.2.1", { type: util.GitHubVariant.GHES, version: "3.11" }, false],
456456
["3.2.1", { type: util.GitHubVariant.GHES, version: "3.12" }, false],
457+
["3.2.1", { type: util.GitHubVariant.GHES, version: "3.19" }, false],
458+
["3.2.1", { type: util.GitHubVariant.GHES, version: "3.20" }, true],
459+
["3.2.1", { type: util.GitHubVariant.GHES, version: "3.21" }, true],
460+
["4.2.1", { type: util.GitHubVariant.DOTCOM }, false],
461+
["4.2.1", { type: util.GitHubVariant.GHE_DOTCOM }, false],
462+
["4.2.1", { type: util.GitHubVariant.GHES, version: "3.19" }, false],
463+
["4.2.1", { type: util.GitHubVariant.GHES, version: "3.20" }, false],
464+
["4.2.1", { type: util.GitHubVariant.GHES, version: "3.21" }, false],
457465
];
458466

459467
for (const [
@@ -480,9 +488,7 @@ for (const [
480488
if (shouldReportError) {
481489
t.true(
482490
warningSpy.calledOnceWithExactly(
483-
sinon.match(
484-
"CodeQL Action major versions v1 and v2 have been deprecated.",
485-
),
491+
sinon.match("CodeQL Action v3 will be deprecated in December 2026."),
486492
),
487493
);
488494
} else {

src/util.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,38 +1114,38 @@ export async function checkDiskUsage(
11141114
}
11151115

11161116
/**
1117-
* Prompt the customer to upgrade to CodeQL Action v3, if appropriate.
1117+
* Prompt the customer to upgrade to CodeQL Action v4, if appropriate.
11181118
*
1119-
* Check whether a customer is running v1 or v2. If they are, and we can determine that the GitHub
1120-
* instance supports v3, then log an error prompting the customer to upgrade to v3.
1119+
* Check whether a customer is running v3. If they are, and we can determine that the GitHub
1120+
* instance supports v4, then log an error prompting the customer to upgrade to v4.
11211121
*/
11221122
export function checkActionVersion(
11231123
version: string,
11241124
githubVersion: GitHubVersion,
11251125
) {
11261126
if (
1127-
!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3
1127+
!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4
11281128
!process.env[EnvVar.LOG_VERSION_DEPRECATION] // do not log error if we have already
11291129
) {
1130-
// Only error for versions of GHES that are compatible with CodeQL Action version 3.
1130+
// Only error for versions of GHES that are compatible with CodeQL Action version 4.
11311131
//
1132-
// GHES 3.11 shipped without the v3 tag, but it also shipped without this warning message code.
1133-
// Therefore users who are seeing this warning message code have pulled in a new version of the
1134-
// Action, and with it the v3 tag.
1132+
// GHES 3.20 is the first version to ship with the v4 tag and this warning message code.
1133+
// Therefore, users who are seeing this warning message code are running on GHES 3.20 or newer,
1134+
// and should update to CodeQL Action v4.
11351135
if (
11361136
githubVersion.type === GitHubVariant.DOTCOM ||
11371137
githubVersion.type === GitHubVariant.GHE_DOTCOM ||
11381138
(githubVersion.type === GitHubVariant.GHES &&
11391139
semver.satisfies(
11401140
semver.coerce(githubVersion.version) ?? "0.0.0",
1141-
">=3.11",
1141+
">=3.20",
11421142
))
11431143
) {
11441144
core.error(
1145-
"CodeQL Action major versions v1 and v2 have been deprecated. " +
1146-
"Please update all occurrences of the CodeQL Action in your workflow files to v3. " +
1145+
"CodeQL Action v3 will be deprecated in December 2026. " +
1146+
"Please update all occurrences of the CodeQL Action in your workflow files to v4. " +
11471147
"For more information, see " +
1148-
"https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/",
1148+
"https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/",
11491149
);
11501150
// set LOG_VERSION_DEPRECATION env var to prevent the warning from being logged multiple times
11511151
core.exportVariable(EnvVar.LOG_VERSION_DEPRECATION, "true");

0 commit comments

Comments
 (0)