From 52077a03d9fb464e28a406fb151daff30a4cbd33 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 17 Jun 2026 15:18:09 +0100 Subject: [PATCH] Ignore empty repository property --- lib/entry-points.js | 2 +- src/config/file.test.ts | 11 +++++++++++ src/config/file.ts | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index ff60cfa20..32474afe4 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -158539,7 +158539,7 @@ function getConfigFileInput(logger, actions, repositoryProperties) { return input; } const propertyValue = repositoryProperties["github-codeql-config-file" /* CONFIG_FILE */]; - if (propertyValue !== void 0) { + if (propertyValue !== void 0 && propertyValue.trim().length > 0) { logger.info( `Using configuration file input from repository property: ${propertyValue}` ); diff --git a/src/config/file.test.ts b/src/config/file.test.ts index c27a3ff5c..4c511c1a7 100644 --- a/src/config/file.test.ts +++ b/src/config/file.test.ts @@ -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); +}); diff --git a/src/config/file.ts b/src/config/file.ts index 6197e50cc..24613dc55 100644 --- a/src/config/file.ts +++ b/src/config/file.ts @@ -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}`, );