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.`,