setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

Support .node-version by default

Open stevelacey opened this issue 2 years ago • 3 comments

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.

stevelacey avatar Jan 30 '23 05:01 stevelacey