node-version as fallback of node-version-file
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- node.js, typescript
- 领域
- ci-cd
调研方向
从 src/main.ts 的第 85-95 行开始,跟踪 node-version 和 node-version-file 的选择方式,然后阅读 src/util.ts 的第 8-12 行,了解文件查找行为。完成的标准是:现有文件具有优先级;当同时提供两个输入时,如果文件缺失,则回退到 node-version,且不会导致 pipeline 崩溃。
由索引模型根据 Issue 内容生成。
描述
Description
Currently the behavior is that node-version is preferred rather than node-version-file if both are provided.
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.
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.
- 主要语言
- TypeScript
- 星标
- 5k
- 派生
- 1.7k
- 平均合并
- 5 天 4 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
actions/setup-node 的其他 Issue
-
feature request
难度 2/5 1-3 小时 新手友好度 65/100
actions/setup-node#1531 · 1 条评论 · 4 个 reaction ·
维护者通常 4 天内回复
-
feature request
难度 5/5 一周以上 新手友好度 30/100
actions/setup-node#1634 · 1 条评论 ·
维护者通常 4 天内回复
-
Volta extends resolution in getNodeVersionFromFile has no cycle detection, recursing until stack overflow可能重新可做 @v-gowridurgad 于 31 天前认领,目前没有进行中的 PR。 未关闭bug
actions/setup-node#1628 · 3 条评论 · 已指派 1 人 ·
维护者通常 4 天内回复
-
`npm config get cache` fails with `EBADDEVENGINES` when requiring newer npm versions in `devEngines`未关闭feature request
难度 4/5 3-5 天 新手友好度 52/100
actions/setup-node#1553 · 14 条评论 · 2 个 reaction ·
维护者通常 4 天内回复
-
feature request
难度 3/5 1-2 天 新手友好度 38/100
actions/setup-node#1428 · 1 条评论 · 3 个 reaction ·
维护者通常 4 天内回复
查看 actions/setup-node 的全部 Issue
相似的 Issue
-
area:tui enhancement platform:macos
难度 2/5 1-3 小时 新手友好度 66/100
anthropics/claude-code#101490 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
netlify/netlify-mcp#75 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
atlassian-labs/compiled#1960 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
pnp/cli-microsoft365#7639 ·
维护者通常 2 天内回复
-
nextjs-tracking
难度 2/5 1-3 小时 新手友好度 74/100
cloudflare/vinext#3887 ·
维护者通常 1 天内回复