Describe the enhancement
core.getInput() should allow the caller to understand whether the value is explicitly set in the yaml file, or whether it is not.
Right now you get an empty string, either when it is not defined, either when the user defined it as an empty string.
Code Snippet
this would allow this code:
const inputValue = core.getInput(inputName) ?? defaultValue;
Right now you have to use this instead:
const inputValue = core.getInput(inputName) || defaultValue;
which is not the same.
Use case
e.g. An action's input is a string which is a list of flags, if the default is "-v" and the user wants to have no flags at all (e.g. flags: ""), having this explicitly stated as input (e.g. flags: "") would be always (uncorrectly) replaced by the default (when using ||). To overcome this the user is forced to define a in the yaml the input as blank space instead (e.g. flags: " ")
Describe the enhancement
core.getInput()should allow the caller to understand whether the value is explicitly set in the yaml file, or whether it is not.Right now you get an empty string, either when it is not defined, either when the user defined it as an empty string.
Code Snippet
this would allow this code:
const inputValue = core.getInput(inputName) ?? defaultValue;Right now you have to use this instead:
const inputValue = core.getInput(inputName) || defaultValue;which is not the same.
Use case
e.g. An action's input is a string which is a list of flags, if the default is "-v" and the user wants to have no flags at all (e.g.
flags: ""), having this explicitly stated as input (e.g.flags: "") would be always (uncorrectly) replaced by the default (when using ||). To overcome this the user is forced to define a in the yaml the input as blank space instead (e.g.flags: " ")