Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core.getInput(): change input name replace regex to [ -]+ #1740

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rindeal
Copy link

@rindeal rindeal commented May 23, 2024

Key Changes:

  1. 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.

  2. 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.

  3. 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 environment variable names at all times. However, this is not currently enforced in functions like core.setOutput(). A decision on this aspect could be considered for future updates.

Closes: #629
Closes: #1659

First and foremost it will allow dashes in names, as that's way-more-commonly used in YAML as opposed to space separators or JS's camelCase.

Furthermore it now replaces consecutive occurrences with a single underscore.
@rindeal rindeal requested a review from a team as a code owner May 23, 2024 15:25
@rindeal rindeal changed the title core: getInput(): change input name replace regex to [ -]+ core.getInput(): change input name replace regex to [ -]+ May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inputs with - are hard to test due to shells not supporting env variables with - in the name
1 participant