Only warn once about the CodeQL CLI being unsupported soon

This commit is contained in:
Henry Mercer 2023-07-06 12:28:03 +01:00
parent 3a960869ac
commit 9b345a50dd
6 changed files with 15 additions and 2 deletions

4
lib/codeql.js generated
View file

@ -31,6 +31,7 @@ const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
const yaml = __importStar(require("js-yaml"));
const actions_util_1 = require("./actions-util");
const config_utils_1 = require("./config-utils");
const environment_1 = require("./environment");
const error_matcher_1 = require("./error-matcher");
const feature_flags_1 = require("./feature-flags");
const languages_1 = require("./languages");
@ -636,6 +637,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
throw new Error(`Expected a CodeQL CLI with version at least ${CODEQL_MINIMUM_VERSION} but got version ${await codeql.getVersion()}`);
}
else if (checkVersion &&
process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] !== "true" &&
!(await util.codeQlVersionAbove(codeql, CODEQL_NEXT_MINIMUM_VERSION))) {
core.warning(`CodeQL CLI version ${await codeql.getVersion()} was deprecated on 2023-06-20 alongside ` +
"GitHub Enterprise Server 3.5 and will not be supported by the next release of the " +
@ -647,6 +649,8 @@ async function getCodeQLForCmd(cmd, checkVersion) {
`${await codeql.getVersion()}, you can replace 'github/codeql-action/*@v2' by ` +
"'github/codeql-action/*@v2.20.4' in your code scanning workflow to ensure you continue " +
"using this version of the CodeQL Action.");
process.env[environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING] = "true";
core.exportVariable(environment_1.EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true");
}
return codeql;
}