mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 12:10:20 +08:00
Merge branch 'aeisenberg/unrevert-query-filters' into aeisenberg/fix-config-files
This commit is contained in:
20
src/util.ts
20
src/util.ts
@@ -15,7 +15,11 @@ import {
|
||||
CODEQL_VERSION_CONFIG_FILES,
|
||||
CODEQL_VERSION_NEW_TRACING,
|
||||
} from "./codeql";
|
||||
import { Config } from "./config-utils";
|
||||
import {
|
||||
Config,
|
||||
parsePacksSpecification,
|
||||
prettyPrintPack,
|
||||
} from "./config-utils";
|
||||
import { Language } from "./languages";
|
||||
import { Logger } from "./logging";
|
||||
|
||||
@@ -679,7 +683,10 @@ export async function getMlPoweredJsQueriesPack(
|
||||
} else {
|
||||
version = `~0.1.0`;
|
||||
}
|
||||
return `${ML_POWERED_JS_QUERIES_PACK_NAME}@${version}`;
|
||||
return prettyPrintPack({
|
||||
name: ML_POWERED_JS_QUERIES_PACK_NAME,
|
||||
version,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -705,11 +712,10 @@ export async function getMlPoweredJsQueriesPack(
|
||||
*/
|
||||
export function getMlPoweredJsQueriesStatus(config: Config): string {
|
||||
const mlPoweredJsQueryPacks = (config.packs.javascript || [])
|
||||
.map((pack) => pack.split("@"))
|
||||
.map((p) => parsePacksSpecification(p))
|
||||
.filter(
|
||||
(packNameVersion) =>
|
||||
packNameVersion[0] === "codeql/javascript-experimental-atm-queries" &&
|
||||
packNameVersion.length <= 2
|
||||
(pack) =>
|
||||
pack.name === "codeql/javascript-experimental-atm-queries" && !pack.path
|
||||
);
|
||||
switch (mlPoweredJsQueryPacks.length) {
|
||||
case 1:
|
||||
@@ -718,7 +724,7 @@ export function getMlPoweredJsQueriesStatus(config: Config): string {
|
||||
// with each version of the CodeQL Action. Therefore in practice we should only hit the
|
||||
// `latest` case here when customers have explicitly added the ML-powered query pack to their
|
||||
// CodeQL config.
|
||||
return mlPoweredJsQueryPacks[0][1] || "latest";
|
||||
return mlPoweredJsQueryPacks[0].version || "latest";
|
||||
case 0:
|
||||
return "false";
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user