Improve string split

This commit is contained in:
Dave Hadka 2020-06-02 10:21:03 -05:00
parent e561127c3e
commit d60d2bef10
8 changed files with 95 additions and 27 deletions

View file

@ -45,3 +45,14 @@ export function logWarning(message: string): void {
export function isValidEvent(): boolean {
return RefKey in process.env && Boolean(process.env[RefKey]);
}
export function getInputAsArray(
name: string,
options?: core.InputOptions
): string[] {
return core
.getInput(name, options)
.split("\n")
.map(s => s.trim())
.filter(x => x !== "");
}