From 3d8236de69c0f437cc84297858f103ea23041b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Fri, 29 May 2026 13:14:23 +0200 Subject: [PATCH] More fixes from CR --- src/resolve-tools-input.test.ts | 10 ++++++++++ src/resolve-tools-input.ts | 11 +++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/resolve-tools-input.test.ts b/src/resolve-tools-input.test.ts index 11adaf1cc..c9c00beba 100644 --- a/src/resolve-tools-input.test.ts +++ b/src/resolve-tools-input.test.ts @@ -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); +}); diff --git a/src/resolve-tools-input.ts b/src/resolve-tools-input.ts index 6f4cbaddf..9ae25e5b9 100644 --- a/src/resolve-tools-input.ts +++ b/src/resolve-tools-input.ts @@ -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.`,