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

Why does node version not follow the actions/setup-node? #241

Closed
hellodword opened this issue Feb 11, 2022 · 3 comments
Closed

Why does node version not follow the actions/setup-node? #241

hellodword opened this issue Feb 11, 2022 · 3 comments
Labels
question A question on how to use this action

Comments

@hellodword
Copy link

v5 only use node v12, and the setup-node does not work.

I found the pr #235 and tried it with uses: actions/github-script@master, now it always use node v16.

As this issue comment said

Unless actions/setup-node is explicitly used, for our hosted runners, the version of Node.js will be whatever is installed in the virtual environment you're using (for example ubuntu-latest). This is documented in "Software installed on GitHub-hosted runners". For example, the current ubuntu-latest, which is 18.04, uses Node.js 12.18.3.

I think this is the best way.

Or is there any security considering that I don't know?

@joshmgross joshmgross added the question A question on how to use this action label Feb 11, 2022
@joshmgross
Copy link
Member

👋 Hey @hellodword,

I don't think that comment is correct - due to how this action is wrapping the passed in script, the version of node used will match the version used by the action

https://github.com/actions/github-script/blob/main/src/async-function.ts

using: node16

The Actions runner bundles its own version of Node to run JavaScript actions - so the version of Node installed by setup-node will never be used.

@hellodword
Copy link
Author

Thanks @joshmgross,

so it's kind of a limit of github actions, right?

Seems it only has node12 and node16, and we can't use dynamic node version as runtime.

@joshmgross
Copy link
Member

so it's kind of a limit of github actions, right?

That's correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question on how to use this action
Projects
None yet
Development

No branches or pull requests

2 participants