(input: string)
| 73 | * If it fails, it returns an array containing the input value as its only element. |
| 74 | */ |
| 75 | export function parseInputArray(input: string): string[] { |
| 76 | core.debug(`Parsing input array: ${input}`); |
| 77 | try { |
| 78 | const yaml = YAML.load(input); |
| 79 | if (yaml && Array.isArray(yaml) && yaml.every(e => typeof e === 'string')) { |
| 80 | core.debug(`Input parsed as YAML array of length ${yaml.length}`); |
| 81 | return yaml; |
| 82 | } |
| 83 | } catch {} // eslint-disable-line no-empty |
| 84 | |
| 85 | core.debug('Input parsed as single string'); |
| 86 | return [input]; |
| 87 | } |
| 88 | |
| 89 | export function readJSON(filePath: string) { |
| 90 | let fileContent: string; |
no outgoing calls
no test coverage detected