Update setup-java for Microsoft's Build of OpenJDK: now pointing task to CDN that is always up-to-date (#1236)

* Updated microsoft openjdk setup-java action

* Update generated distribution

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Applied new fixes from npm run check

* Update generated distribution

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
jmjaffe37
2026-08-14 01:10:57 -04:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent d2bb5a81bf
commit 3487f54461
6 changed files with 116400 additions and 20 deletions
+3 -12
View File
@@ -8,7 +8,6 @@ import {
cacheJdkDir,
extractJdkFile,
getDownloadArchiveExtension,
getGitHubHttpHeaders,
renameWinArchive
} from '../../util.js';
import * as gpg from '../../gpg.js';
@@ -128,19 +127,11 @@ export class MicrosoftDistributions extends JavaBase {
}
private async getAvailableVersions(): Promise<tc.IToolRelease[] | null> {
// TODO get these dynamically!
// We will need Microsoft to add an endpoint where we can query for versions.
const owner = 'actions';
const repository = 'setup-java';
const branch = 'main';
const filePath =
'src/distributions/microsoft/microsoft-openjdk-versions.json';
let releases: tc.IToolRelease[] | null = null;
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
const headers = getGitHubHttpHeaders();
const fileUrl = `https://aka.ms/download-jdk/microsoft-openjdk-versions.json`;
// Avoid leaking the GitHub token to a non-GitHub host (aka.ms redirects to a CDN).
const headers = {accept: 'application/json'};
let response: TypedResponse<tc.IToolRelease[]> | null = null;
if (core.isDebug()) {