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

What version of node is used in Actions to run gh-scripts? #76

Closed
ahmadnassri opened this issue Aug 4, 2020 · 12 comments
Closed

What version of node is used in Actions to run gh-scripts? #76

ahmadnassri opened this issue Aug 4, 2020 · 12 comments

Comments

@ahmadnassri
Copy link
Contributor

The documentation does not detail what version of node is used to execute, and whether actions/setup-node would of any use / relevance?

@jclem
Copy link
Contributor

jclem commented Aug 5, 2020

Hi @ahmadnassri, good question! 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.

If you're using self-hosted runners, the installed version of Node.js may differ.

@jclem jclem closed this as completed Aug 5, 2020
@ahmadnassri
Copy link
Contributor Author

interesting... setup-node with 14 didn't seem to have the desired effect in my testing. (was using Null Coalescing Operator in my script) but ... I've moved to a separate full action now so I can't revisit easily ...

regardless, this would be useful to document in the readme.

thanks

@jclem
Copy link
Contributor

jclem commented Aug 5, 2020

@ahmadnassri Can you point me to the workflow file, if it's public?

@ahmadnassri
Copy link
Contributor Author

it isn't public unfortunately

@ahmadnassri
Copy link
Contributor Author

I'll keep this issue in my tabs and might come back to it later and make another test on a public repo to share

@ylemkimon
Copy link

AFAIK, the runner runs JS action with Node.js 12 regardless of actions/setup-node:

using: node12

@kf6kjg
Copy link

kf6kjg commented May 14, 2021

The current ubuntu-latest runner is Ubuntu 20.04.2 which, according to the docs is provided with Node 14.16.1.

I set up a job with the following statements:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/[email protected]
        with:
          node-version: 14

      - run: |
          console.debug({nodeVersion: process.version});
        shell: node --input-type=module {0}

      - uses: actions/[email protected]
        with:
          script: |
            console.debug({nodeVersion: process.version});

And got the following as results from the console logs:

{ nodeVersion: 'v14.16.1' }

{ nodeVersion: 'v12.13.1' }

So I'd say that this action is overriding the version supplied by both the environment AND actions/setup-node. This is very annoying as it means that code I compiled from TS to JS for ES2020 will not execute due to the usage of the nullish coalescing operator and other features introduced in 14.

Please revisit this.

@kf6kjg
Copy link

kf6kjg commented May 14, 2021

Looks like node14 isn't yet available to JavaScript actions: actions/runner#772 Though it looks like there's been some recent motion on that front.

To workaround that would require being able to execute the provided script using the system node outside of the current node process.

@luisrudge
Copy link

runners already support node v16, but this action uses node@12 anyway. is there a way to force it to use v16?

@joshmgross
Copy link
Member

runners already support node v16, but this action uses node@12 anyway. is there a way to force it to use v16?

👋 @luisrudge with #235 and actions/github@v6, this action is now using Node 16.

@luisrudge
Copy link

luisrudge commented Feb 11, 2022

@joshmgross great! is v6 already available?

@joshmgross
Copy link
Member

is v6 already available?

Yep! https://github.com/actions/github-script/releases

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

6 participants