mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 09:14:58 +00:00
Ignore empty repository property
This commit is contained in:
2
lib/entry-points.js
generated
2
lib/entry-points.js
generated
@@ -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}`
|
||||
);
|
||||
|
||||
@@ -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