dcodeIO / setup-node-nvm

Set up your GitHub Actions workflow with a specific version of node.js using nvm.
21 stars 13 forks source link

Pass process.env onto child processes #10

Closed jordaneb closed 3 years ago

jordaneb commented 3 years ago

Hi @dcodeIO,

Thank you for the great action.

We're using this action on some private repos and it looks like this line (https://github.com/actions/toolkit/blob/main/packages/core/src/core.ts#L69) inside @actions/core is causing us problems. It seems like GITHUB_ENV is not being found in the environment and so the library tries to use add-path method to add the directory to PATH which breaks of course!

It's odd that the unit tests for this action don't seem to be affected by my change and I can't seem to figure out why...

That said, in one of the repos where the build is failing this change has resolved the problem and is now passing again.

Do you think the change I've proposed is appropriate? :)

Many thanks

jordaneb commented 3 years ago

I've misread the documentation (https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) and env defaults to process.env anyway so my change here isn't valid.

Oddly referencing the commit from my fork fixes this but changing it back to dcodeIO/setup-node-nvm@v4.0.0 causes it to use add-path again so I'm guessing something inside GitHub actions might be working unexpectedly.

jordaneb commented 3 years ago

I've just changed the uses line from dcodeIO/setup-node-nvm@v4.0.0 to dcodeIO/setup-node-nvm@v4 and now the build is passing. 😕

jordaneb commented 3 years ago

Ah I understand what's happened, there's two releases:

I had read v2.0.0 from the CI config file before and replace the 2 with a 4 to bring it up to the latest not realising v4 and v4.0.0 were two totally different versions so my bad.

All working now though!