-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use node version config files if node-version input is omitted #239
Conversation
can we push forward this feature? |
edit: this was all based on an inaccurate assumption which has since been corrected. I like the idea, but I would be wary of using https://www.npmjs.com/package/preferred-node-version as it stands. Per the documentation for that tool (without any first-hand experience) it seems to prioritize nvm, then package.json and then all other version managers. That's fine for a specific node package like https://www.npmjs.com/package/preferred-node-version to use; but that's inappropriate for github's official node action. I would suggest the official action should prioritize a version file that isn't version-manager specific (like |
Hi everyone (I maintain that library)! For reference, this is the current priority order. The current logic prioritizes version manager-specific files because they are more specific. For example, After those comes Finally comes the environment variables: |
@ehmicky thanks for clarifying and correcting my misinterpretation! I retract my "opposition" to this PR. My (inaccurate) assumption was based solely on the phrasing of the readme:
|
One note: the library can throw. For example, if the project has an |
I believe a hard failure would be expected here. I don't think there's any reason why an invalid nodejs version should fail silently. |
thanks @ehmicky – i'll update the description of the PR to reflect the ordering |
Is there any blocker to merging this? |
@Macavirus I'm not sure. Currently 2 checks are failing but i've followed the advice and don't understand what the issues are. I'm also not clear whether GitHub would be interested in merging it either. @jasonkarns are you able to advise? In the meantime, we're using https://github.com/guardian/actions-setup-node at the guardian (basically this PR) if that's any help to anyone |
@sndrs I'm not a member of the team and do not have any capability to merge or weigh in on the PR more than anyone else here. So far I haven't seen a github team member in this thread. |
@jasonkarns lol sorry! i'm not sure where i got that idea from – sorry to alert you :) @bryanmacfarlane (because you last merged a PR in the repo – apologies if you too are the wrong person) are you able to advise if this is something that might get merged? if so, any advice on how i can fix the broken checks? |
@gordey4doronin @maxim-lobanov @dmitry-shibanov no reviews here? 😞 |
got confused with working with forks and accidentally closed this. not intentional |
Oh, nice. There are conflicts, BTW. |
8cbc915
to
4fad61a
Compare
4fad61a
to
8cbc915
Compare
# Conflicts: # dist/index.js # package-lock.json
9979dd8
to
26286a0
Compare
hopefully the conflicts are dealt with and license checks now pass (they pass for our fork at https://github.com/guardian/actions-setup-node and which is still used across the guardian). be great if someone is able to kick them off? (or just close this PR if it's not going to be merged so i can stop updating it 😄) |
@maxim-lobanov given #338 and that no one from GitHub has ever responded to this PR, should I just close it? getting strong vibes GitHub's not all that interested 😉 |
thanks everyone for your input. GitHub are going with their own solution in #338 so I'm closing this. in case anyone is using the fork I mentioned, we'll archive it when the official action supports version files natively, so it should keep working but won't get upstream updates |
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.28.2 to 4.28.3. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.3/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This PR uses @ehmicky's
preferred-node-version
to attempt to determine a node version to use if you omitnode-version
before it falls back to the PATH version.It checks the following places (edited to reflect @ehmicky's comment below):
.n-node-version
.naverc
.node-version
.nodeenvrc
.nvmrc
(accurately parsing nvm versions)package.json#engines.node
and finally the following environment variables:
NODIST_NODE_VERSION
NODE_VERSION
DEFAULT_NODE_VERSION
We're using this approach at the guardian (in a fork) and it seems to work well.
But we'd rather stay official :)