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

Dynamically detect node binary #308

Open
rethab opened this issue May 10, 2021 · 0 comments
Open

Dynamically detect node binary #308

rethab opened this issue May 10, 2021 · 0 comments

Comments

@rethab
Copy link

rethab commented May 10, 2021

Hi, as far as I understand this action requires node to be in the PATH. This is the case for GitHub's runners, because they have node preinstalled (at least on ubuntu). Runners that don't have node installed, could use eg. https://github.com/actions/setup-node to make sure node is available in the PATH.

However that seems unnecessary. node will be available from the action runner (see https://github.com/actions/runner/blob/be9632302ceef50bfb36ea998cea9c94c75e5d4d/docs/checks/nodejs.md) so installing it again should not be necessary. The only problem is that that location is not in the PATH.

My question is: Would it be possible to extend this action such that it can fall back to the pre-installed node binary by dynamically finding it? If this sounds like a good idea, I could possibly see if I can create the PR.


Side note: You can also extend the PATH manually, but I'm not sure how reliable the directory for node is:

- name: Setup node
  run: echo "/actions-runner/externals/node12/bin" >> $GITHUB_PATH
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

1 participant