Temurin version incorrectly converted for setup-java 6.0.x

未关闭 适合新手
#1,270 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, java, typescript
领域
ci-cd, devops

调研方向

从 src/distributions/base-installer.ts 的第 681-689 行附近开始,这里正则表达式处理 Java 版本。使用 26.0.2.1+1 和 25.0.4.1+1 等 Temurin 版本重现该失败,然后验证 setup-java 能够成功解析这些版本,且不会出现 SemVer 错误。

由索引模型根据 Issue 内容生成。

描述

bug

Description:
After upgrade from 5.7.0 to 6.0.0 and 6.0.1, I noticed that setup-java does not recognize Temurin's versions anymore (e.g. "26.0.2+10"). This leads to an "is not valid SemVer notation for a Java version" error.

The following regular expression does not not pick up Temurin's version correctly:

https://github.com/actions/setup-java/blob/1aa87b638dacaa70f1c903fa9ec9cbd91058e2ff/src/distributions/base-installer.ts#L681-L689

The issue seems to be similar to: https://github.com/actions/setup-java/issues/1267

Task version:
v6, v6.0.1

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Expected behavior:
Successfully resolve Temurin version.

Actual behavior:
setup-java >= 6.0.0 returns

The string '26.0.2.1+1' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information

主要语言
TypeScript
星标
2k
派生
870
平均合并
3 小时 16 分钟
30 天内合并 PR
11

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。