mirror of
https://github.com/actions/cache.git
synced 2025-04-22 03:56:45 +00:00
Improve string split
This commit is contained in:
parent
e561127c3e
commit
d60d2bef10
8 changed files with 95 additions and 27 deletions
|
@ -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 !== "");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue