mirror of
https://github.com/actions/setup-java.git
synced 2026-08-19 04:02:51 +00:00
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:
co-authored by
Copilot Autofix powered by AI
parent
d2bb5a81bf
commit
3487f54461
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user