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

make sure values not provided by users resolve to undefined #144

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

softprops
Copy link
Owner

@softprops softprops commented Aug 10, 2021

addresses at least part of #142 #140 and #139

to summarize, after much trial and error I discovered an interesting quirk with the actions runtime env. all inputs (with values) are exposed to actions as env variables of the form INPUT_${inputname.toUpperCase()} even when users don't provide them which is not what you might expect from process.env

the actions runtime provides these instead as present with empty strings. since we use this as rest api inputs and value with an empty string != the absence of a value and hence things did not go as expected

I realized this when running experiments in a test repo using debug branch of this action and printed the param structs before requesting info from the api.

this theory also lines up with #139 (comment)

I was able to validate this pulls change on that branch with this test

https://github.com/softprops/action-gh-releases-test/actions/runs/1115229438

note: there are still a few quirks left over from recent changes like duplicate content of release bodies (see #140 (comment)) but I'd like to get this, the most significant change in first

@softprops softprops marked this pull request as ready for review August 10, 2021 03:57
@softprops softprops merged commit 730b76a into master Aug 10, 2021
@softprops softprops deleted the undefine-what-should-be-undefined branch August 10, 2021 03:57
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.

1 participant