core.getInput()
: change input name replace regex to [ -]+
#1740
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Key Changes
Support for Dashed Input Names: The updated
core.getInput()
function now supports querying inputs using names with dashes. This is a shift from the current requirement of using underscore-separated names, aligning more closely with the common practice of using dashed names in YAML.Single Underscore for Consecutive Occurrences: The function has been updated to replace consecutive occurrences of the special characters with a single underscore. This makes the input names cleaner and more readable.
Documentation Updates: Accompanying these changes, the documentation has been updated to reflect the new functionality.
Considerations for Future Updates:
The changes introduced in this pull request may necessitate a review of the allowed characters in input names. Given that input names are intended to follow the form
INPUT_${inputName}
, they should ideally adhere to the restrictions on Posix shell environment variable names at all times. However, this is not currently enforced in functions likecore.setOutput()
. A decision on this aspect could be considered for future updates.Context
The space to underscore replacement is done in the runner as well, and the code has been there since the first public release, so the reason behind it all is not known.
https://github.com/actions/runner/blob/7303cb56735ea8969f2785fa1b19d7ce9510eca7/src/Runner.Worker/Handlers/Handler.cs#L184-L186
Closes: #629
Closes: #1659