mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 08:33:16 +08:00
actions/toolkit#127: getInput supports variables with multiple spaces (#129)
* actions/toolkit#127: getInput supports variables with multiple spaces * actions/toolkit#127: PR comment, update changelog
This commit is contained in:
committed by
Danny McCormick
parent
b297969f56
commit
6fcaac5046
@@ -72,7 +72,7 @@ export function addPath(inputPath: string): void {
|
||||
*/
|
||||
export function getInput(name: string, options?: InputOptions): string {
|
||||
const val: string =
|
||||
process.env[`INPUT_${name.replace(' ', '_').toUpperCase()}`] || ''
|
||||
process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''
|
||||
if (options && options.required && !val) {
|
||||
throw new Error(`Input required and not supplied: ${name}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user