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

Wrong interpretation of null when setting up action options #85

Closed
dfdez opened this issue Jun 10, 2023 · 3 comments
Closed

Wrong interpretation of null when setting up action options #85

dfdez opened this issue Jun 10, 2023 · 3 comments

Comments

@dfdez
Copy link

dfdez commented Jun 10, 2023

When taking a look to this issue actions/checkout#1378 we have found that the problem was rewarding this action.

Just to give a brief context @bzbarsky-apple was reporting tha sparse-checkout was running when it didn't add any option related to sparse-checkout. And after some digging I figure out that the problem might be related with this line of code.

if( !( key in options ) && inputs[ key ].default !== undefined )

In the actions/checkout we set sparse-checkout to null but it seems that this default value when evaluated on this action is turning the default value null to "null".

The reason for this is because wretry.action evaluates all the inputs. In the process of creating the default input INPUT_SPARSE_CHECKOUT the env is set to null and when reading from the process.env instead of being a null value is a literal string "null"

process.env[ key ] = options[ key ];

That is why in this job without setting up sparse-checkout wretry.action is setting up the env INPUT_SPARSE_CHECKOUT=null creating indirectly a default value of sparse-checkout: "null" on the actions/checkout options

@dmvict
Copy link
Collaborator

dmvict commented Jun 20, 2023

Hello, @dfdez

Here is PR #100 with the fix.

I will notify you when it will be published.

@dmvict
Copy link
Collaborator

dmvict commented Jun 22, 2023

Hello, @dfdez

The new version is released. Please try v1.2.0 and close the issue if it solves the problem.

@dfdez
Copy link
Author

dfdez commented Jun 22, 2023

Before v1.2.0:

image

With v1.2.0:

image

Working perfect! Nice job! 🥳

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