Skip to content

Commit 7beb642

Browse files
committed
Move after Git version check
1 parent 546ea07 commit 7beb642

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

lib/init-action.js

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -916,27 +916,6 @@ export async function initConfig(
916916

917917
const config = await initActionState(inputs, userConfig);
918918

919-
// If we are in CCR or the corresponding FF is enabled, try to determine
920-
// which files in the repository are marked as generated and add them to
921-
// the `paths-ignore` configuration.
922-
if ((await features.getValue(Feature.IgnoreGeneratedFiles)) && isCCR()) {
923-
try {
924-
const generatedFiles = await getGeneratedFiles(inputs.sourceRoot);
925-
926-
if (generatedFiles.length > 0) {
927-
config.computedConfig["paths-ignore"] ??= [];
928-
config.computedConfig["paths-ignore"].push(...generatedFiles);
929-
logger.info(
930-
`Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${generatedFiles.join(", ")}`,
931-
);
932-
}
933-
} catch (error) {
934-
logger.info(`Cannot ignore generated files: ${getErrorMessage(error)}`);
935-
}
936-
} else {
937-
logger.debug(`Skipping check for generated files.`);
938-
}
939-
940919
// If Code Quality analysis is the only enabled analysis kind, then we will initialise
941920
// the database for Code Quality. That entails disabling the default queries and only
942921
// running quality queries. We do not currently support query customisations in that case.
@@ -974,6 +953,27 @@ export async function initConfig(
974953
}
975954
}
976955

956+
// If we are in CCR or the corresponding FF is enabled, try to determine
957+
// which files in the repository are marked as generated and add them to
958+
// the `paths-ignore` configuration.
959+
if ((await features.getValue(Feature.IgnoreGeneratedFiles)) && isCCR()) {
960+
try {
961+
const generatedFiles = await getGeneratedFiles(inputs.sourceRoot);
962+
963+
if (generatedFiles.length > 0) {
964+
config.computedConfig["paths-ignore"] ??= [];
965+
config.computedConfig["paths-ignore"].push(...generatedFiles);
966+
logger.info(
967+
`Detected ${generatedFiles.length} generated file(s), which will be excluded from analysis: ${generatedFiles.join(", ")}`,
968+
);
969+
}
970+
} catch (error) {
971+
logger.info(`Cannot ignore generated files: ${getErrorMessage(error)}`);
972+
}
973+
} else {
974+
logger.debug(`Skipping check for generated files.`);
975+
}
976+
977977
// The choice of overlay database mode depends on the selection of languages
978978
// and queries, which in turn depends on the user config and the augmentation
979979
// properties. So we need to calculate the overlay database mode after the

0 commit comments

Comments
 (0)