Temurin version incorrectly converted for setup-java 6.0.x
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 870
- Avg merge
- 3h 16m
- Merged PRs (30d)
- 11
Description
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:
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:
- successful run for setup-java "5.7.0" and Temurin "26.0.2+10", "25.0.4+7"
- failed runs for setup-java "6.0.0" and Temurin "26.0.2.1+1", "25.0.4.1+1"
- failed runs for setup-java "6.0.1" and Temurin "26.0.2.1+1", "25.0.4.1+1"
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/distributions/base-installer.ts around lines 681-689, where the regular expression handles Java versions. Reproduce the failure with Temurin versions such as 26.0.2.1+1 and 25.0.4.1+1, then verify that setup-java successfully resolves these versions without the SemVer error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, java, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100