actions / actions/setup-node

Support .node-version by default

Open
#683 6 comments 15 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
TypeScript
Stars
5k
Forks
1.7k
Avg merge
3d 12h
Merged PRs (30d)
2

Description

Description:
In addition to supporting the node-version and node-version-file inputs, the workflow should check .node-version when neither input is supplied, and only fallback to latest if neither input was supplied, and that file does not exist.

Justification:
Specifying node-version/node-version-file in every setup-node usage is tedious and inconsistent with other setup-{lang} actions which usually check a version file by default in addition to supporting a {lang}-version-file input.

The setup-python and setup-ruby actions already do this, they use .python-version/.ruby-version files if they exist and no inputs are passed, and setup-php will automatically use .php-version once https://github.com/shivammathur/setup-php/pull/690 is released.

Are you willing to submit a PR?
Yes, absolutely, it may be worth supporting .nvmrc too given it's popularity, but maybe that's contentious, I haven't found any other actions that support a version manager's version file, though IIRC Heroku does honor it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript implementation and tests that handle the node-version and node-version-file inputs. Verify the precedence between those inputs, .node-version, and latest, then add coverage showing the expected fallback behavior; decide separately whether .nvmrc belongs in scope because the issue identifies it as potentially contentious.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.