From 9b49e27edb33d4815e3f01b1be7767ea30aecbcf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 29 May 2026 11:39:28 +0000 Subject: [PATCH] Allow repository tools property fallback in resolveToolsInput --- src/config/resolve-tools-input.test.ts | 12 +++++------- src/config/resolve-tools-input.ts | 13 ++----------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/config/resolve-tools-input.test.ts b/src/config/resolve-tools-input.test.ts index 92e86a3c7..00f60c0db 100644 --- a/src/config/resolve-tools-input.test.ts +++ b/src/config/resolve-tools-input.test.ts @@ -114,7 +114,7 @@ test("resolveToolsInput returns undefined when repository property is undefined" t.is(loggedMessages.length, 0); }); -test("resolveToolsInput ignores repository property when fallback is disabled", (t) => { +test("resolveToolsInput returns repository property when fallback is disabled", (t) => { const loggedMessages: LoggedMessage[] = []; const logger = getRecordingLogger(loggedMessages); @@ -128,13 +128,11 @@ test("resolveToolsInput ignores repository property when fallback is disabled", logger, ); - t.is(result, undefined); + t.is(result, "toolcache"); t.is(loggedMessages.length, 1); - const fallbackDisabledMessage = String(loggedMessages[0].message); - t.true( - /Ignoring 'github-codeql-tools' repository property because it is only supported for dynamic workflows\./.test( - fallbackDisabledMessage, - ), + t.is( + loggedMessages[0].message, + "Setting tools: toolcache based on the 'github-codeql-tools' repository property.", ); }); diff --git a/src/config/resolve-tools-input.ts b/src/config/resolve-tools-input.ts index 24af52874..c7d890f72 100644 --- a/src/config/resolve-tools-input.ts +++ b/src/config/resolve-tools-input.ts @@ -10,14 +10,14 @@ import { Logger } from "../logging"; * falls back to the repository property (if set and enabled for this workflow). * * @param toolsWorkflowInput - The value of the `tools` workflow input, if provided. - * @param allowRepositoryPropertyFallback - Whether the repository property fallback is enabled. + * @param _allowRepositoryPropertyFallback - Reserved for backwards compatibility. * @param repositoryProperties - The parsed repository properties. * @param logger - Logger for outputting resolution messages. * @returns The effective tools input value. */ export function resolveToolsInput( toolsWorkflowInput: string | undefined, - allowRepositoryPropertyFallback: boolean, + _allowRepositoryPropertyFallback: boolean, repositoryProperties: RepositoryProperties, logger: Logger, ): string | undefined { @@ -30,15 +30,6 @@ export function resolveToolsInput( const toolsPropertyValue = repositoryProperties[RepositoryPropertyName.TOOLS]; - if (!allowRepositoryPropertyFallback) { - 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; - } - if (toolsPropertyValue) { logger.info( `Setting tools: ${toolsPropertyValue} based on the '${RepositoryPropertyName.TOOLS}' repository property.`,