Skip to content

Commit 52077a0

Browse files
committed
Ignore empty repository property
1 parent b2cc23e commit 52077a0

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

lib/entry-points.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config/file.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,14 @@ test("getConfigFileInput returns repository property value", async (t) => {
5656
),
5757
);
5858
});
59+
60+
test("getConfigFileInput ignores empty repository property value", async (t) => {
61+
const logger = new RecordingLogger();
62+
const actionsEnv = getTestActionsEnv();
63+
64+
// Since the repository property value is an empty/whitespace string, we should ignore it.
65+
const result = getConfigFileInput(logger, actionsEnv, {
66+
[RepositoryPropertyName.CONFIG_FILE]: " ",
67+
});
68+
t.is(result, undefined);
69+
});

src/config/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function getConfigFileInput(
2323
const propertyValue =
2424
repositoryProperties[RepositoryPropertyName.CONFIG_FILE];
2525

26-
if (propertyValue !== undefined) {
26+
if (propertyValue !== undefined && propertyValue.trim().length > 0) {
2727
logger.info(
2828
`Using configuration file input from repository property: ${propertyValue}`,
2929
);

0 commit comments

Comments
 (0)