Skip to content

Support pinning java-version as "latest"#1091

Closed
brunoborges with Copilot wants to merge 1 commit into
mainfrom
copilot/support-pinning-java-version-latest
Closed

Support pinning java-version as "latest"#1091
brunoborges with Copilot wants to merge 1 commit into
mainfrom
copilot/support-pinning-java-version-latest

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description:

Adds a latest alias for java-version that resolves to the newest available stable release, enabling workflows to test against bleeding-edge Java without pinning a specific major on every release. Scoped to latest only (the separate lts request is out of scope).

- uses: actions/setup-java@v5
  with:
    distribution: temurin
    java-version: latest
  • Central resolution (src/distributions/base-installer.ts): normalizeVersion maps latest (case-insensitive) to the SemVer wildcard x, which flows through the existing highest-match selection. This covers all range-matching distributions (Temurin, Zulu, Adopt, Liberica, Semeru, Dragonwell, Kona, SapMachine, JetBrains, Microsoft).
  • Corretto (src/distributions/corretto/installer.ts): only matches exact majors, so the wildcard is resolved to the newest available major, with a safe fallback to the standard not-found error when no numeric major exists.
  • Docs (README.md): documented the latest alias under supported version syntax.
  • Tests: normalizeVersion('latest') variants and Corretto latest resolution.

Note: URL-constructing distributions (Oracle, GraalVM) don't enumerate a resolvable latest major, so latest is unsupported there and surfaces a clear version-not-found error.

Check list:

  • Ran npm run check locally (format, lint, build, test) and all checks pass.
  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Copilot AI linked an issue Jul 9, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add support for pinning java-version as "latest" Support pinning java-version as "latest" Jul 9, 2026
Copilot AI requested a review from brunoborges July 9, 2026 18:53
@brunoborges brunoborges closed this Jul 9, 2026
Copilot stopped work on behalf of brunoborges due to an error July 9, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support pinning java-version as "latest"

2 participants