-
Notifications
You must be signed in to change notification settings - Fork 469
Expand file tree
/
Copy pathfile.ts
More file actions
34 lines (29 loc) · 922 Bytes
/
Copy pathfile.ts
File metadata and controls
34 lines (29 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { ActionsEnv } from "../actions-util";
import {
RepositoryProperties,
RepositoryPropertyName,
} from "../feature-flags/properties";
import { Logger } from "../logging";
/**
* Gets the value that is configured for the configuration file, if any.
*/
export function getConfigFileInput(
logger: Logger,
actions: ActionsEnv,
repositoryProperties: Partial<RepositoryProperties>,
): string | undefined {
const input = actions.getOptionalInput("config-file");
if (input !== undefined) {
logger.info(`Using configuration file input from workflow: ${input}`);
return input;
}
const propertyValue =
repositoryProperties[RepositoryPropertyName.CONFIG_FILE];
if (propertyValue !== undefined && propertyValue.trim().length > 0) {
logger.info(
`Using configuration file input from repository property: ${propertyValue}`,
);
return propertyValue;
}
return undefined;
}