From 393543671afa6aaff6d7fa13ca09a23ebb6ba9fe Mon Sep 17 00:00:00 2001 From: Gregory Mitchell Date: Thu, 28 Nov 2024 19:43:01 +0000 Subject: [PATCH] Add Hidden JDK 11 Versions --- dist/setup/index.js | 8 ++++++-- src/distributions/jetbrains/installer.ts | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index ac08326..31a73f8 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -124592,11 +124592,12 @@ class JetBrainsDistribution extends base_installer_1.JavaBase { // GitHub API doesn't provide way to retrieve the count of pages to iterate so infinity loop let page_index = 1; const rawVersions = []; + const bearerToken = process.env.GITHUB_TOKEN; while (true) { const requestArguments = `per_page=100&page=${page_index}`; const requestHeaders = {}; - if (process.env.GITHUB_TOKEN) { - requestHeaders['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`; + if (bearerToken) { + requestHeaders['Authorization'] = `Bearer ${bearerToken}`; } const rawUrl = `https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?${requestArguments}`; if (core.isDebug() && page_index === 1) { @@ -124611,6 +124612,9 @@ class JetBrainsDistribution extends base_installer_1.JavaBase { rawVersions.push(...paginationPage); page_index++; } + // Add versions not available from the API but are downloadable + const hidden = ['11_0_10b1145.115', '11_0_11b1341.60']; + rawVersions.push(...hidden.map(tag => ({ tag_name: tag, name: tag }))); const versions0 = rawVersions.map((v) => __awaiter(this, void 0, void 0, function* () { var _a; // Release tags look like one of these: diff --git a/src/distributions/jetbrains/installer.ts b/src/distributions/jetbrains/installer.ts index adbf776..ed0b49f 100644 --- a/src/distributions/jetbrains/installer.ts +++ b/src/distributions/jetbrains/installer.ts @@ -96,12 +96,14 @@ export class JetBrainsDistribution extends JavaBase { // GitHub API doesn't provide way to retrieve the count of pages to iterate so infinity loop let page_index = 1; const rawVersions: IJetBrainsRawVersion[] = []; + const bearerToken = process.env.GITHUB_TOKEN; + while (true) { const requestArguments = `per_page=100&page=${page_index}`; const requestHeaders: OutgoingHttpHeaders = {}; - if (process.env.GITHUB_TOKEN) { - requestHeaders['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`; + if (bearerToken) { + requestHeaders['Authorization'] = `Bearer ${bearerToken}`; } const rawUrl = `https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?${requestArguments}`; @@ -123,6 +125,10 @@ export class JetBrainsDistribution extends JavaBase { page_index++; } + // Add versions not available from the API but are downloadable + const hidden = ['11_0_10b1145.115', '11_0_11b1341.60']; + rawVersions.push(...hidden.map(tag => ({tag_name: tag, name: tag}))); + const versions0 = rawVersions.map(async v => { // Release tags look like one of these: // jbr-release-21.0.3b465.3