Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temurin .tool-versions specifier not parsed #719

Open
2 of 5 tasks
alexpearce opened this issue Jan 8, 2025 · 1 comment
Open
2 of 5 tasks

Temurin .tool-versions specifier not parsed #719

alexpearce opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@alexpearce
Copy link

Description:

A .tool-versions file with a valid Temurin version specifier is parsed as having a null version.

Given the following .tool-versions:

java temurin-21.0.5+11.0.LTS

I can install Java locally with asdf:

asdf plugin-add java https://github.com/halcyon/asdf-java.git
asdf install java

(The list of valid versions is given by asdf list-all java.)

But with the following action configuration:

- uses: actions/[email protected]
    with:
      distribution: "temurin"
      java-version-file: ".tool-versions"

The action fails to parse the version.

Relevant debug log:

  ##[debug]java-version input is empty, looking for java-version-file input
  ##[debug]Parsed version from file 'null'
  Error: No supported version was found in file .tool-versions
  ##[debug]Node Action run completed with exit code 1
  ##[debug]Finishing: Set up Java

This happens because the version regex does not accept the trailing .0.LTS. In other words, a .tool-versions content of java temurin-21.0.5+11 would pass the regex, but would not be a version known to the asdf plugin.

Task version:

v4.6.0.

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Create .tool-versions file at repository root with contents:

java temurin-21.0.5+11.0.LTS

Use action configuration:

- uses: actions/[email protected]
        with:
          distribution: "temurin"
          java-version-file: ".tool-versions"

Expected behavior:

The action should install Temurin JDK 21.0.5+11.0.LTS.

Actual behavior:

The action does not parse the version.

@alexpearce alexpearce added bug Something isn't working needs triage labels Jan 8, 2025
@aparnajyothi-y
Copy link
Contributor

Hello @alexpearce, Thank you for creating this issue and we will look into it :)

@aparnajyothi-y aparnajyothi-y self-assigned this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants