Skip to content

Temurin version incorrectly converted for setup-java 6.0.x #1270

Description

@paulie-of-punskas

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:

if (/^\d+(\.\d+){3,}$/.test(version)) {
version = convertVersionToSemver(version);
}
if (!semver.validRange(version)) {
throw new Error(
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
);
}

The issue seems to be similar to: #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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions