Ignore empty repository property

This commit is contained in:
Michael B. Gale
2026-06-17 15:18:09 +01:00
parent b2cc23e25d
commit 52077a03d9
3 changed files with 13 additions and 2 deletions

View File

@@ -56,3 +56,14 @@ test("getConfigFileInput returns repository property value", async (t) => {
),
);
});
test("getConfigFileInput ignores empty repository property value", async (t) => {
const logger = new RecordingLogger();
const actionsEnv = getTestActionsEnv();
// Since the repository property value is an empty/whitespace string, we should ignore it.
const result = getConfigFileInput(logger, actionsEnv, {
[RepositoryPropertyName.CONFIG_FILE]: " ",
});
t.is(result, undefined);
});

View File

@@ -23,7 +23,7 @@ export function getConfigFileInput(
const propertyValue =
repositoryProperties[RepositoryPropertyName.CONFIG_FILE];
if (propertyValue !== undefined) {
if (propertyValue !== undefined && propertyValue.trim().length > 0) {
logger.info(
`Using configuration file input from repository property: ${propertyValue}`,
);