Skip to content

Commit 3d8236d

Browse files
committed
More fixes from CR
1 parent b1eeb13 commit 3d8236d

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/resolve-tools-input.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,13 @@ test("resolveToolsInput ignores repository property when fallback is disabled",
133133
),
134134
);
135135
});
136+
137+
test("resolveToolsInput does not log when fallback is disabled and repository property is not set", (t) => {
138+
const loggedMessages: LoggedMessage[] = [];
139+
const logger = getRecordingLogger(loggedMessages);
140+
141+
const result = resolveToolsInput(undefined, false, {}, logger);
142+
143+
t.is(result, undefined);
144+
t.is(loggedMessages.length, 0);
145+
});

src/resolve-tools-input.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ export function resolveToolsInput(
2828
return toolsWorkflowInput;
2929
}
3030

31+
const toolsPropertyValue = repositoryProperties[RepositoryPropertyName.TOOLS];
32+
3133
if (!allowRepositoryPropertyFallback) {
32-
logger.info(
33-
`No explicit tools input was provided. Ignoring '${RepositoryPropertyName.TOOLS}' repository property because it is only supported for dynamic workflows.`,
34-
);
34+
if (toolsPropertyValue) {
35+
logger.info(
36+
`No explicit tools input was provided. Ignoring '${RepositoryPropertyName.TOOLS}' repository property because it is only supported for dynamic workflows.`,
37+
);
38+
}
3539
return undefined;
3640
}
3741

38-
const toolsPropertyValue = repositoryProperties[RepositoryPropertyName.TOOLS];
3942
if (toolsPropertyValue) {
4043
logger.info(
4144
`Setting tools: ${toolsPropertyValue} based on the '${RepositoryPropertyName.TOOLS}' repository property.`,

0 commit comments

Comments
 (0)