Use computedConfig for pack telemetry

This commit is contained in:
Michael B. Gale
2025-09-02 18:14:32 +01:00
parent 7f81363b78
commit d332aa98b6
2 changed files with 8 additions and 38 deletions

View File

@@ -75,7 +75,6 @@ import {
ConfigurationError,
wrapError,
checkActionVersion,
cloneObject,
getErrorMessage,
} from "./util";
import { validateWorkflow } from "./workflow";
@@ -206,28 +205,10 @@ async function sendCompletedStatusReport(
}
let packs: Record<string, string[]> = {};
if (
(config.augmentationProperties.packsInputCombines ||
!config.augmentationProperties.packsInput) &&
config.originalUserInput.packs
) {
// Make a copy, because we might modify `packs`.
const copyPacksFromOriginalUserInput = cloneObject(
config.originalUserInput.packs,
);
// If it is an array, then assume there is only a single language being analyzed.
if (Array.isArray(copyPacksFromOriginalUserInput)) {
packs[config.languages[0]] = copyPacksFromOriginalUserInput;
} else {
packs = copyPacksFromOriginalUserInput;
}
}
if (config.augmentationProperties.packsInput) {
packs[config.languages[0]] ??= [];
packs[config.languages[0]].push(
...config.augmentationProperties.packsInput,
);
if (Array.isArray(config.computedConfig.packs)) {
packs[config.languages[0]] = config.computedConfig.packs;
} else if (config.computedConfig.packs !== undefined) {
packs = config.computedConfig.packs;
}
// Append fields that are dependent on `config`