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

Feature request: Support .node-version to specify the version #206

Open
karszawa opened this issue Oct 27, 2020 · 0 comments
Open

Feature request: Support .node-version to specify the version #206

karszawa opened this issue Oct 27, 2020 · 0 comments

Comments

@karszawa
Copy link

@karszawa karszawa commented Oct 27, 2020

I'm using nodenv to handle a lot of versions of node binaries on my computer. It provides a .node-version file to change node version based on the current directory. So, I specify the local node version by .node-version as well as setup-node input in GitHub Actions.

In this case, I want to make a .node-version file the only place where the node version is notated. To achieve this, I sometimes read .node-version and provide the result to setup-node like this:

	steps:
	  - uses: actions/checkout@v1

      - name: Read .node-version
        run: echo ::set-output name=NODE_VERSION::$(cat .node-version | cut -c 2-)
        id: nvm

      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: ${{ steps.nvm.outputs.NODE_VERSION }}

This is acceptable, but I think it is a better option for setup-node to have node-version-file as another way to specify the node version like this:

	steps:
	  - uses: actions/checkout@v1

      - name: Setup Node.js
        uses: actions/setup-node@v2-beta
        with:
          node-version-path: '.node-version' # it should be configurable for something like monorepo project which does not have .node-version on the root

I'm willing to implement this feature if the team accepts the idea. Thanks for reading my proposal 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.