rollForward: latestMajor installs the latest LTS SDK even when it is older than sdk.version
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- github-actions, typescript
调研方向
Start at getVersionFromGlobalJson and createChannelArgument, then trace how minimumVersion is used when selecting or installing an SDK; the issue describes the failing latestMajor path. Reproduce with the provided global.json and workflow on an Ubuntu runner, then check relevant tests for global.json and channel selection. Done when the selected SDK satisfies the declared minimum and the step cannot succeed after installing an incompatible SDK.
由索引模型根据 Issue 内容生成。
描述
Description:
With rollForward: "latestMajor", getVersionFromGlobalJson clears the version (case 'latestMajor': version = ''), and createChannelArgument then resolves the empty version to --channel LTS. The declared sdk.version is kept only as minimumVersion, which filters already-installed SDKs but is never checked against what gets downloaded. When the required SDK belongs to a newer STS release, the action installs an older LTS SDK that does not satisfy global.json, and the step still succeeds.
dotnet-channel: STS cannot work around it: it only applies when dotnet-version: latest, and the version taken from global.json is empty, so the channel is ignored with a warning.
Task version:
v6.1.0
Platform:
- Ubuntu
- macOS
- Windows
(Observed on Ubuntu; the code path is platform-independent.)
Runner type:
- Hosted
- Self-hosted
Repro steps:
global.json:
{
"sdk": {
"version": "11.0.100",
"rollForward": "latestMajor",
"allowPrerelease": false
}
}
Workflow step:
- uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
Expected behavior:
The newest SDK that satisfies global.json: at least 11.0.100, or the newest active release if that is higher, matching how the dotnet host resolves latestMajor.
Actual behavior:
The SDK step resolves to the LTS channel and installs 10.0.x, below the declared sdk.version:
/__w/_actions/actions/setup-dotnet/v6/externals/install-dotnet.sh --skip-non-versioned-files --channel LTS
dotnet-install: Attempting to download using aka.ms link https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.404/dotnet-sdk-10.0.404-linux-x64.tar.gz
...
dotnet-install: Installed version is 10.0.404
dotnet-install: Installation finished successfully.
The step succeeds, so the mismatch only surfaces later, when the build cannot find an SDK that satisfies global.json.
Suggested fix:
For latestMajor, pick the newest active channel in the releases index whose version is at least minimumVersion, rather than always using LTS; or fail when the installed SDK is older than minimumVersion.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 579
- 平均合并
- 6 天 4 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
actions/setup-dotnet 的其他 Issue
-
bug needs triage
难度 3/5 1-2 天 新手友好度 57/100
actions/setup-dotnet#807 · 1 个 reaction ·
-
feature request
难度 3/5 1-2 天 新手友好度 68/100
actions/setup-dotnet#801 · 1 条评论 · 1 个 reaction ·
-
feature request
难度 5/5 一周以上 新手友好度 45/100
actions/setup-dotnet#778 · 3 条评论 · 1 个 reaction ·
-
feature request
难度 5/5 一周以上 新手友好度 25/100
actions/setup-dotnet#701 · 3 条评论 ·
-
feature request
难度 1/5 1 小时以内 新手友好度 55/100
actions/setup-dotnet#659 · 1 条评论 · 2 个 reaction ·
查看 actions/setup-dotnet 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 87/100
维护者通常 1 天内回复
-
🛠️ dette technique
难度 2/5 1-3 小时 新手友好度 61/100
betagouv/mon-entreprise#4752 · 1 条评论 ·
维护者通常 5 天内回复
-
type: bug
难度 2/5 1-3 小时 新手友好度 67/100
franciscoBSalgueiro/en-croissant#1111 ·
维护者通常 2 天内回复
-
area/providers type/feature version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#64845 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复