More fixes from CR

This commit is contained in:
Óscar San José
2026-05-29 13:14:23 +02:00
parent b1eeb13c4c
commit 3d8236de69
2 changed files with 17 additions and 4 deletions
+10
View File
@@ -133,3 +133,13 @@ test("resolveToolsInput ignores repository property when fallback is disabled",
),
);
});
test("resolveToolsInput does not log when fallback is disabled and repository property is not set", (t) => {
const loggedMessages: LoggedMessage[] = [];
const logger = getRecordingLogger(loggedMessages);
const result = resolveToolsInput(undefined, false, {}, logger);
t.is(result, undefined);
t.is(loggedMessages.length, 0);
});
+7 -4
View File
@@ -28,14 +28,17 @@ export function resolveToolsInput(
return toolsWorkflowInput;
}
const toolsPropertyValue = repositoryProperties[RepositoryPropertyName.TOOLS];
if (!allowRepositoryPropertyFallback) {
logger.info(
`No explicit tools input was provided. Ignoring '${RepositoryPropertyName.TOOLS}' repository property because it is only supported for dynamic workflows.`,
);
if (toolsPropertyValue) {
logger.info(
`No explicit tools input was provided. Ignoring '${RepositoryPropertyName.TOOLS}' repository property because it is only supported for dynamic workflows.`,
);
}
return undefined;
}
const toolsPropertyValue = repositoryProperties[RepositoryPropertyName.TOOLS];
if (toolsPropertyValue) {
logger.info(
`Setting tools: ${toolsPropertyValue} based on the '${RepositoryPropertyName.TOOLS}' repository property.`,