You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using core.getInput in a composite action, the returned value is empty.
To Reproduce
Steps to reproduce the behavior:
Create a composite action with an input
Use github-script action and try core.getInput on the input
Use the composite action in a workflow
Set the input with a value
See error
Expected behavior
The value should be returned as provided
Additional context
The root cause is known and is on actions/runner side (here) but i think we should so something about it in here too. A warning about missing env var could be a quick win, and avoid people not knowing why it failed.
thrownewError(`Input required and not supplied: ${name}`)
}
if(options&&options.trimWhitespace===false){
returnval
}
returnval.trim()
}
exportfunctiongetInput(name: string,options?: InputOptions): string{constinputKey=`INPUT_${name.replace(//g,'_').toUpperCase()` const val: string = process.env[inputKey] || '' if (!(inputKey in process.env)) { warn(`theinput '${inputKey}' is missing from env`)}if(options&&options.required&&!val){thrownewError(`Input required and not supplied: ${name}`)}if(options&&options.trimWhitespace===false){returnval}returnval.trim()}
The text was updated successfully, but these errors were encountered:
If you're trying to get an input while using actions/github-script, as I am, you can work around this by just using normal expression substitutions (orwhatever they're called):
Describe the bug
When using
core.getInput
in a composite action, the returned value is empty.To Reproduce
Steps to reproduce the behavior:
core.getInput
on the inputExpected behavior
The value should be returned as provided
Additional context
The root cause is known and is on actions/runner side (here) but i think we should so something about it in here too. A warning about missing env var could be a quick win, and avoid people not knowing why it failed.
Proposed implementation
toolkit/packages/core/src/core.ts
Lines 117 to 138 in 1b5a6e2
The text was updated successfully, but these errors were encountered: