Use joinAtMost for log message

This commit is contained in:
Michael B. Gale
2026-01-21 13:12:28 +00:00
parent 6a02be43ee
commit 9e2fa7419d
2 changed files with 10 additions and 2 deletions

9
lib/init-action.js generated
View File

@@ -87186,6 +87186,13 @@ async function asyncSome(array, predicate) {
function isDefined(value) {
return value !== void 0 && value !== null;
}
function joinAtMost(array, separator, limit) {
if (limit > 0 && array.length > limit) {
array = array.slice(0, limit);
array.push("...");
}
return array.join(separator);
}
// src/actions-util.ts
var pkg = require_package();
@@ -89637,7 +89644,7 @@ async function initConfig(features, inputs) {
config.computedConfig["paths-ignore"] ??= [];
config.computedConfig["paths-ignore"].push(...generatedFiles);
logger.info(
`Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${generatedFiles.join(", ")}`
`Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${joinAtMost(generatedFiles, ", ", 10)}`
);
} else {
logger.info(`Found no generated files.`);

View File

@@ -60,6 +60,7 @@ import {
getCodeQLMemoryLimit,
getErrorMessage,
isInTestMode,
joinAtMost,
} from "./util";
export * from "./config/db-config";
@@ -964,7 +965,7 @@ export async function initConfig(
config.computedConfig["paths-ignore"] ??= [];
config.computedConfig["paths-ignore"].push(...generatedFiles);
logger.info(
`Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${generatedFiles.join(", ")}`,
`Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${joinAtMost(generatedFiles, ", ", 10)}`,
);
} else {
logger.info(`Found no generated files.`);