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

inputs.who-to-greet.required should be set to false since the parameter has a default value #16

Closed
ilyasotkov opened this issue Aug 21, 2020 · 2 comments
Assignees

Comments

@ilyasotkov
Copy link

I can use this Action without supplying any inputs and the default for who-to-greet input variable is "World". Why is it documented (in action.yml and README.md) as required?

And more generally, why would Metadata syntax for GitHub Actions
specification even allow required: true and default to be specified together?

@ncalteen
Copy link
Collaborator

I believe the option to specify both required: true and default: is because the default value may not exist (if you're using one of the different actions contexts. For example, if you use the following:

inputs:
  who-to-greet:
    description: '...'
    required: true
    default: ${{ env.MY_ENV_VAR }}

If MY_ENV_VAR is not set, then the default value will be an empty string. Hence, setting this as a required input would prevent the action from trying to run without necessary inputs.

@ncalteen ncalteen self-assigned this Nov 7, 2023
@ncalteen
Copy link
Collaborator

ncalteen commented Nov 7, 2023

Hello! Closing this out for now, but if you're still running into any kind of issue please reopen and let me know! I will try to respond soon as I can :)

@ncalteen ncalteen closed this as completed Nov 7, 2023
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

No branches or pull requests

2 participants