Skip to content

Commit 9b345a5

Browse files
committed
Only warn once about the CodeQL CLI being unsupported soon
1 parent 3a96086 commit 9b345a5

File tree

6 files changed

+15
-2
lines changed

6 files changed

+15
-2
lines changed

lib/codeql.js

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

lib/codeql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/environment.js

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

lib/environment.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codeql.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as yaml from "js-yaml";
88
import { getOptionalInput } from "./actions-util";
99
import * as api from "./api-client";
1010
import { Config, getGeneratedCodeScanningConfigPath } from "./config-utils";
11+
import { EnvVar } from "./environment";
1112
import { errorMatchers } from "./error-matcher";
1213
import {
1314
CodeQLDefaultVersionInfo,
@@ -1040,6 +1041,7 @@ export async function getCodeQLForCmd(
10401041
);
10411042
} else if (
10421043
checkVersion &&
1044+
process.env[EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
10431045
!(await util.codeQlVersionAbove(codeql, CODEQL_NEXT_MINIMUM_VERSION))
10441046
) {
10451047
core.warning(
@@ -1054,6 +1056,8 @@ export async function getCodeQLForCmd(
10541056
"'github/codeql-action/*@v2.20.4' in your code scanning workflow to ensure you continue " +
10551057
"using this version of the CodeQL Action."
10561058
);
1059+
process.env[EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] = "true";
1060+
core.exportVariable(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true");
10571061
}
10581062
return codeql;
10591063
}

src/environment.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export enum EnvVar {
4141

4242
ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION",
4343

44+
/** Whether to suppress the warning if the current CLI will soon be unsupported. */
45+
SUPPRESS_DEPRECATED_SOON_WARNING = "CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING",
46+
4447
/** Used to disable uploading SARIF results or status reports to the GitHub API */
4548
TEST_MODE = "CODEQL_ACTION_TEST_MODE",
4649

0 commit comments

Comments
 (0)