mirror of
https://gitea.com/actions/setup-java.git
synced 2026-10-02 21:25:25 +08:00
Accept 4-part versions with build metadata (X.Y.Z.P+B -> X.Y.Z+P.B) and match exact Temurin requests against OpenJDK-derived version keys, since the Adoptium API semver folds the patch into the build number (26.0.2+101) and adds LTS metadata (25.0.4+7.0.LTS). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -43,6 +43,7 @@ const core = await import('@actions/core');
|
||||
|
||||
const {
|
||||
convertVersionToSemver,
|
||||
normalizeJavaVersionToSemver,
|
||||
getNextPageUrlFromLinkHeader,
|
||||
getVersionFromFileContent,
|
||||
isVersionSatisfies,
|
||||
@@ -188,6 +189,22 @@ describe('convertVersionToSemver', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('normalizeJavaVersionToSemver', () => {
|
||||
it.each([
|
||||
['17', '17'],
|
||||
['17.0.8', '17.0.8'],
|
||||
['17.0.8+7', '17.0.8+7'],
|
||||
['11.0.9.1', '11.0.9+1'],
|
||||
['12.0.2.1.0', '12.0.2+1.0'],
|
||||
['26.0.2.1+1', '26.0.2+1.1'],
|
||||
['17.0.8.1+1080.1', '17.0.8+1.1080.1'],
|
||||
['>=11.0.9.1', '>=11.0.9.1'],
|
||||
['17.x', '17.x']
|
||||
])('%s -> %s', (input: string, expected: string) => {
|
||||
expect(normalizeJavaVersionToSemver(input)).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getNextPageUrlFromLinkHeader', () => {
|
||||
it.each([
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user