mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Ignore empty repository property
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user