Skip to content

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

Closed

Description

@hellodword

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?

Activity

  1. joshmgross commented on Feb 11, 2022

    @joshmgross
    Contributor

    👋 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.

  2. hellodword commented on Feb 12, 2022

    @hellodword
    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.

  3. joshmgross commented on Feb 14, 2022

    @joshmgross
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question on how to use this action

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy