mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Log !analysisKindSupported case
This commit is contained in:
8
lib/entry-points.js
generated
8
lib/entry-points.js
generated
@@ -148503,15 +148503,19 @@ async function getConfigFileInput({
|
|||||||
}
|
}
|
||||||
const propertyValue = repositoryProperties["github-codeql-config-file" /* CONFIG_FILE */];
|
const propertyValue = repositoryProperties["github-codeql-config-file" /* CONFIG_FILE */];
|
||||||
const analysisKindSupported = analysisKinds === void 0 || analysisKinds.includes("code-scanning" /* CodeScanning */) && analysisKinds.length === 1;
|
const analysisKindSupported = analysisKinds === void 0 || analysisKinds.includes("code-scanning" /* CodeScanning */) && analysisKinds.length === 1;
|
||||||
if (analysisKindSupported && propertyValue !== void 0 && propertyValue.trim().length > 0) {
|
if (propertyValue !== void 0 && propertyValue.trim().length > 0) {
|
||||||
const useRepositoryProperty = await features.getValue(
|
const useRepositoryProperty = await features.getValue(
|
||||||
"config_file_repository_property" /* ConfigFileRepositoryProperty */
|
"config_file_repository_property" /* ConfigFileRepositoryProperty */
|
||||||
);
|
);
|
||||||
if (useRepositoryProperty) {
|
if (analysisKindSupported && useRepositoryProperty) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Using configuration file input from repository property: ${propertyValue}`
|
`Using configuration file input from repository property: ${propertyValue}`
|
||||||
);
|
);
|
||||||
return propertyValue;
|
return propertyValue;
|
||||||
|
} else if (!analysisKindSupported) {
|
||||||
|
logger.info(
|
||||||
|
"Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind."
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
logger.info(
|
logger.info(
|
||||||
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled."
|
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled."
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ test("getConfigFileInput ignores repository property for other analysis kinds",
|
|||||||
// Since the analysis kind is unsupported, we should ignore the repository property.
|
// Since the analysis kind is unsupported, we should ignore the repository property.
|
||||||
await target
|
await target
|
||||||
.withArgs(repositoryProperties, unsupportedCase)
|
.withArgs(repositoryProperties, unsupportedCase)
|
||||||
|
.logs(
|
||||||
|
t,
|
||||||
|
"Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.",
|
||||||
|
)
|
||||||
.passes(t.is, undefined);
|
.passes(t.is, undefined);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -55,21 +55,21 @@ export async function getConfigFileInput(
|
|||||||
(analysisKinds.includes(AnalysisKind.CodeScanning) &&
|
(analysisKinds.includes(AnalysisKind.CodeScanning) &&
|
||||||
analysisKinds.length === 1);
|
analysisKinds.length === 1);
|
||||||
|
|
||||||
if (
|
if (propertyValue !== undefined && propertyValue.trim().length > 0) {
|
||||||
analysisKindSupported &&
|
|
||||||
propertyValue !== undefined &&
|
|
||||||
propertyValue.trim().length > 0
|
|
||||||
) {
|
|
||||||
// Only use the repository property value if the FF is enabled.
|
// Only use the repository property value if the FF is enabled.
|
||||||
const useRepositoryProperty = await features.getValue(
|
const useRepositoryProperty = await features.getValue(
|
||||||
Feature.ConfigFileRepositoryProperty,
|
Feature.ConfigFileRepositoryProperty,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (useRepositoryProperty) {
|
if (analysisKindSupported && useRepositoryProperty) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Using configuration file input from repository property: ${propertyValue}`,
|
`Using configuration file input from repository property: ${propertyValue}`,
|
||||||
);
|
);
|
||||||
return propertyValue;
|
return propertyValue;
|
||||||
|
} else if (!analysisKindSupported) {
|
||||||
|
logger.info(
|
||||||
|
"Ignoring configuration file input from repository property, because it is unsupported for the current analysis kind.",
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
logger.info(
|
logger.info(
|
||||||
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",
|
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",
|
||||||
|
|||||||
Reference in New Issue
Block a user