-
Notifications
You must be signed in to change notification settings - Fork 85
fix: use core.getBooleanInput()
to retrieve boolean input values
#223
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: use core.getBooleanInput()
to retrieve boolean input values
#223
Conversation
@parkerbxyz PTAL~ |
We checked if the more strict interpretation of We are just having a look at the tests |
core.getBooleanInput()
to retrieve boolean input valuescore.getBooleanInput()
to retrieve boolean input values
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.
Thanks, @Yang-33! ✨
This PR switches from evaluating values passed to
skip-token-revoke
as true if they are truthy in JavaScript, to usinggetBooleanInput
. This change ensures that only proper YAML boolean values are recognized, preventing unintended evaluations to true.getBooleanInput
is here: definition ofcore#getBooealnInput
is here: https://github.com/actions/toolkit/blob/930c89072712a3aac52d74b23338f00bb0cfcb24/packages/core/src/core.ts#L188-L208The documentation states,
"If truthy, the token will not be revoked when the current job is complete"
, so this change could be considered a breaking change. This means that if there are users who rely ontruthy
and expect values like whitespace or"false"
to be evaluated as true (though this is likely rare), it would be a breaking change.Boolean(" ")
andBoolean("false")
are both evaluated as true.Alternatively, it can simply be considered a fix. How to handle this is up to the maintainer.
Resolve #216