mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 09:14:58 +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 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(
|
||||
"config_file_repository_property" /* ConfigFileRepositoryProperty */
|
||||
);
|
||||
if (useRepositoryProperty) {
|
||||
if (analysisKindSupported && useRepositoryProperty) {
|
||||
logger.info(
|
||||
`Using configuration file input from repository property: ${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 {
|
||||
logger.info(
|
||||
"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.
|
||||
await target
|
||||
.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);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -55,21 +55,21 @@ export async function getConfigFileInput(
|
||||
(analysisKinds.includes(AnalysisKind.CodeScanning) &&
|
||||
analysisKinds.length === 1);
|
||||
|
||||
if (
|
||||
analysisKindSupported &&
|
||||
propertyValue !== undefined &&
|
||||
propertyValue.trim().length > 0
|
||||
) {
|
||||
if (propertyValue !== undefined && propertyValue.trim().length > 0) {
|
||||
// Only use the repository property value if the FF is enabled.
|
||||
const useRepositoryProperty = await features.getValue(
|
||||
Feature.ConfigFileRepositoryProperty,
|
||||
);
|
||||
|
||||
if (useRepositoryProperty) {
|
||||
if (analysisKindSupported && useRepositoryProperty) {
|
||||
logger.info(
|
||||
`Using configuration file input from repository property: ${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 {
|
||||
logger.info(
|
||||
"Ignoring configuration file input from repository property, because the corresponding feature flag is disabled.",
|
||||
|
||||
Reference in New Issue
Block a user