Ignore empty repository property

This commit is contained in:
Michael B. Gale committed 2026-06-17 15:18:14 +01:00
1 parent b2cc23e25d
commit 52077a03d9
3 files changed
+13 -2

No files matched your search

+1 -1
View File
@@ -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}`
);
+11
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);
});
+1 -1
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}`,
);