-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix boolean handling #140
fix boolean handling #140
Conversation
2491fa0
to
973eaea
Compare
Copying my comment from the issue thread:
Additionally, I will need to double check what |
Cool - no rush. I was just digging around and figured I may as well open a
PR :)
As for the string default - does that mean GitHub will itself throw an
error if you pass in a Boolean? If so, this tool could also check that the
action.yaml is following the spec and throw. Otherwise if GitHub lets it
through, we should probably also handle it, even if not officially part of
the spec.
|
To be extra pedantic, I ran the following tests to confirm behavior:
So it looks like the schema itself is not really enforced. The only one that should error out is an optional input with no value. In that case, I believe the scenario you pointed out in issue 1 should still throw a |
Can you also bump the version in |
re: throwing an error - If the item is marked as optional, it seems unexpected to throw an error when empty. It's effectively saying there is no such thing as an optional boolean. Either coercing to false or leaving it empty/undefined seem reasonable to me, but throwing an error doesn't feel quite right. If I want to have an optional boolean input, I would now have to wrap getting the value in a try/catch. re: versioning - I can bump this one, but I'd strongly recommend setting up some automation with either https://github.com/changesets/changesets or https://www.npmjs.com/package/release-it. |
I don't disagree, but that would be a change that needs to happen in the |
ah of course - that makes sense. Forgot for a sec what this tool was actually doing 😅 Will make changes and should be ready to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉 Thanks for the support!
fixes 2 issues, although you may want to adjust how its done...
1 - optional booleans were throwing an error when empty. Not sure if you want to return undefined, or just default to false if empty.
2 - boolean defaults were causing issues when unquoted in the yaml file