Move after Git version check

This commit is contained in:
Michael B. Gale
2026-01-19 14:12:04 +00:00
parent 546ea07303
commit 7beb64218a
2 changed files with 37 additions and 37 deletions
+21 -21
View File
@@ -916,27 +916,6 @@ export async function initConfig(
const config = await initActionState(inputs, userConfig);
// If we are in CCR or the corresponding FF is enabled, try to determine
// which files in the repository are marked as generated and add them to
// the `paths-ignore` configuration.
if ((await features.getValue(Feature.IgnoreGeneratedFiles)) && isCCR()) {
try {
const generatedFiles = await getGeneratedFiles(inputs.sourceRoot);
if (generatedFiles.length > 0) {
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(", ")}`,
);
}
} catch (error) {
logger.info(`Cannot ignore generated files: ${getErrorMessage(error)}`);
}
} else {
logger.debug(`Skipping check for generated files.`);
}
// If Code Quality analysis is the only enabled analysis kind, then we will initialise
// the database for Code Quality. That entails disabling the default queries and only
// running quality queries. We do not currently support query customisations in that case.
@@ -974,6 +953,27 @@ export async function initConfig(
}
}
// If we are in CCR or the corresponding FF is enabled, try to determine
// which files in the repository are marked as generated and add them to
// the `paths-ignore` configuration.
if ((await features.getValue(Feature.IgnoreGeneratedFiles)) && isCCR()) {
try {
const generatedFiles = await getGeneratedFiles(inputs.sourceRoot);
if (generatedFiles.length > 0) {
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(", ")}`,
);
}
} catch (error) {
logger.info(`Cannot ignore generated files: ${getErrorMessage(error)}`);
}
} else {
logger.debug(`Skipping check for generated files.`);
}
// The choice of overlay database mode depends on the selection of languages
// and queries, which in turn depends on the user config and the augmentation
// properties. So we need to calculate the overlay database mode after the