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
Current @action/core getInput replaces the name string to find it as env variable in the process. It changes any whitespace with underscore. So if the name is potato it tries to find INPUT_POTATO. If the name is one potato it tries to find INPUT_ONE_POTATO. But it does only replace white spaces. Any given dash/hyphen example keeps it with the dash/hyphen, what is an invalid case on bash or POSIX shells.
Actions allow arguments with dash/hyphen like the example here:
# Define your inputs here.inputs:
who-to-greet:
description: Who to greetrequired: truedefault: World
So I assume there is an existing preprocessing for GitHub actions where any dash/hyphen separated key gets transformed to underscore, as GitHub uses Octokit and it doesn't accept dash/hyphen in variables keys either.
This is a problem outside of GitHub ecosystem or without using the action.yml as if you want to reuse the library (for example in GitLab) the use of dash/hyphen is not accepted.
To Reproduce
Try to use @action/core getInput call with an dash/hyphen case.
should swap any white space and any dash/hyphen with an underscore, creating a valid environment variable key. That should allow anyone using the action outside from a github action to consume it.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Core here: https://github.com/actions/toolkit/blob/main/packages/core/src/core.ts#L153
Current @action/core getInput replaces the name string to find it as env variable in the process. It changes any whitespace with underscore. So if the name is
potato
it tries to findINPUT_POTATO
. If the name isone potato
it tries to findINPUT_ONE_POTATO
. But it does only replace white spaces. Any given dash/hyphen example keeps it with the dash/hyphen, what is an invalid case on bash or POSIX shells.Actions allow arguments with dash/hyphen like the example here:
So I assume there is an existing preprocessing for GitHub actions where any dash/hyphen separated key gets transformed to underscore, as GitHub uses Octokit and it doesn't accept dash/hyphen in variables keys either.
This is a problem outside of GitHub ecosystem or without using the action.yml as if you want to reuse the library (for example in GitLab) the use of dash/hyphen is not accepted.
To Reproduce
Try to use
@action/core
getInput call with an dash/hyphen case.Expected behavior
Replacing the regex with:
should swap any white space and any dash/hyphen with an underscore, creating a valid environment variable key. That should allow anyone using the action outside from a github action to consume it.
The text was updated successfully, but these errors were encountered: