mirror of
https://github.com/gradle/actions.git
synced 2025-04-22 10:49:20 +08:00
in a best effort manner by default allowing to specify files to hash for computing the cache key
19 lines
481 B
TypeScript
19 lines
481 B
TypeScript
import * as core from '@actions/core'
|
|
|
|
export function inputOrNull(name: string): string | null {
|
|
const inputString = core.getInput(name, {required: false})
|
|
if (inputString.length === 0) {
|
|
return null
|
|
}
|
|
return inputString
|
|
}
|
|
|
|
export function inputArrayOrNull(name: string): string[] | null {
|
|
const string = inputOrNull(name)
|
|
if (!string) return null
|
|
return string
|
|
.split('\n')
|
|
.map(s => s.trim())
|
|
.filter(s => s !== '')
|
|
}
|