Temurin version incorrectly converted for setup-java 6.0.x

Open Beginner friendly
#1,270 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, java, typescript
Domain
ci-cd, devops

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.

Description

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

Dominant language
TypeScript
Stars
2k
Forks
870
Avg merge
3h 16m
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.