Skip to content

Support .node-version by default #683

Open
@stevelacey

Description

@stevelacey

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 shivammathur/setup-php#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions