Repository navigation
5.1.0 fails to read .tool-versions #967
Description
Activity
- addedbugSomething isn't workingSomething isn't working
on Dec 4, 2025 Hello @othmane-kinane-nw 👋,
Thank you for your report. We'll investigate the issue and get back to you with the details!Reacted by Othmane KINANEHello @othmane-kinane-nw, Thanks for raising this and for sharing the detailed comparison between 5.0.0 and 5.1.0, really appreciate the clarity here.
We’ve taken a closer look, and the behavior change you’re seeing is tied to how version strings are parsed from .tool-versions in 5.1.0. As part of the improvements made in PR #767, the parsing logic was tightened to align with the documented asdf format and to avoid extracting invalid version identifiers. In 5.0.0, the parser was more permissive and accepted strings such as:
java temurin-v21.0.7However, this format is not currently supported. The documented and intended pattern (as described in the PR) is:
java temurin-21.0.7
(without the leading v in the version segment)In 5.1.0, the updated regex correctly excludes v21.0.7 because it treats the v prefix as part of the distribution token rather than the numeric version as per asdf format. As a result, the extracted value is no longer a valid Java version, and the action reports:
Error: No supported version was found in file api/.tool-versions. So from the action’s perspective, this is expected behavior in 5.1.0, the parser is now enforcing the documented .tool-versions structure.Tried to remove the leading v and update the entry to:
java temurin-21.0.7the action should work as expected under 5.1.0. Please find the screenshot for reference.
Please feel free to reach us in case of further concerns or clarifiactions required :)

I removed the
vand it worked !Thank you @aparnajyothi-y 🙏
Reacted by v-aparnajyothi-y
Action versions
actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165(5.0.0)actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e(5.1.0)Config
File:
api/.tool-versionsWorkflow usage (simplified)
Steps to reproduce
api/.tool-versionswith the content above.java-version-file: api/.tool-versionswith the 5.1.0 action.Actual behavior (5.1.0 – f2beeb2)
The step fails with:
Expected behavior (5.0.0 – dded088)
The same file works and Java 21.0.7 is resolved, downloaded, and configured successfully.
Full logs
5.1.0 (failing)
5.0.0 (working)