Improve string split

This commit is contained in:
Dave Hadka committed 2020-06-02 17:07:33 -05:00
1 parent e561127c3e
commit d60d2bef10
8 files changed
+95 -27

No files matched your search

+11
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 !== "");
}