Description
Description
Currently the behavior is that node-version
is preferred rather than node-version-file
if both are provided.
Lines 85 to 95 in d86ebcd
I would like to propose the opposite since node-version
is actually hardcoded in the action parameters, but the file is not guaranteed to be there.
Lines 8 to 12 in d86ebcd
Currently, scenarios resolved as following:
with:
node-version: 8 # nothing to see here
with:
node-version-file: fileExists.json # all good
with:
node-version-file: fileDoesNotExists.json # throws error and crashes the pipeline
with:
node-version: 8
node-version-file: fileExists.json # ignored, picked version is 8
with:
node-version: 8
node-version-file: fileDoesNotExists.json # ignored, picked version is 8
What I'm requesting for is a change in the 2 lasts scenarios:
with:
node-version: 8
node-version-file: fileExists.json # has priority, so it's picked
with:
node-version: 8
node-version-file: fileDoesNotExists.json # does not throw and picks version 8 instead
Justification
This is just a nicer API, i think. it does not remove the case of conscious crash of the pipeline if no node-version
is given, but it does nicely propose a fail-safe for people interested.
Note
We could also have another parameter such as node-version-fallback-if-file-not-found
but it'd just increase the complexity of the api.
Are you willing to submit a PR?
Yes, i'm ok with that.