Skip to content

Commit

Permalink
core.getInput: Replace dash with underscore
Browse files Browse the repository at this point in the history
actions#629 Dashed environment variable is invalid in most system
  • Loading branch information
el7cosmos committed Apr 27, 2021
1 parent e76deca commit 2635b35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/core.ts
Expand Up @@ -83,7 +83,9 @@ export function addPath(inputPath: string): void {
*/
export function getInput(name: string, options?: InputOptions): string {
const val: string =
process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''
process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] ||
process.env[`INPUT_${name.replace(/-/g, '_').toUpperCase()}`] ||
''
if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`)
}
Expand Down

0 comments on commit 2635b35

Please sign in to comment.