Skip to content

Commit 2d4c474

Browse files
committed
Log !analysisKindSupported case
1 parent 8289a49 commit 2d4c474

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

lib/entry-points.js

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

src/config/file.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ test("getConfigFileInput ignores repository property for other analysis kinds",
7979
// Since the analysis kind is unsupported, we should ignore the repository property.
8080
await target
8181
.withArgs(repositoryProperties, unsupportedCase)
82+
.logs(
83+
t,
84+
"Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.",
85+
)
8286
.passes(t.is, undefined);
8387
}
8488
});

src/config/file.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ export async function getConfigFileInput(
5555
(analysisKinds.includes(AnalysisKind.CodeScanning) &&
5656
analysisKinds.length === 1);
5757

58-
if (
59-
analysisKindSupported &&
60-
propertyValue !== undefined &&
61-
propertyValue.trim().length > 0
62-
) {
58+
if (propertyValue !== undefined && propertyValue.trim().length > 0) {
6359
// Only use the repository property value if the FF is enabled.
6460
const useRepositoryProperty = await features.getValue(
6561
Feature.ConfigFileRepositoryProperty,
6662
);
6763

68-
if (useRepositoryProperty) {
64+
if (analysisKindSupported && useRepositoryProperty) {
6965
logger.info(
7066
`Using configuration file input from repository property: ${propertyValue}`,
7167
);
7268
return propertyValue;
69+
} else if (!analysisKindSupported) {
70+
logger.info(
71+
"Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.",
72+
);
7373
} else {
7474
logger.info(
7575
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",

0 commit comments

Comments
 (0)