From d23aed3c8013ac5aebf678f946502684c7dd156c Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 15 Dec 2021 18:23:49 +0300 Subject: [PATCH] Add an error condition for an unstable Microsoft OpenJDK build (#263) --- dist/setup/index.js | 3 +++ src/distributions/microsoft/installer.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/dist/setup/index.js b/dist/setup/index.js index 855880b7..fd2ca809 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -13886,6 +13886,9 @@ class MicrosoftDistributions extends base_installer_1.JavaBase { if (this.architecture !== 'x64' && this.architecture !== 'aarch64') { throw new Error(`Unsupported architecture: ${this.architecture}`); } + if (!this.stable) { + throw new Error('Early access versions are not supported'); + } const availableVersionsRaw = yield this.getAvailableVersions(); const opts = this.getPlatformOption(); const availableVersions = availableVersionsRaw.map(item => ({ diff --git a/src/distributions/microsoft/installer.ts b/src/distributions/microsoft/installer.ts index 79fffe5e..477cb62e 100644 --- a/src/distributions/microsoft/installer.ts +++ b/src/distributions/microsoft/installer.ts @@ -40,6 +40,11 @@ export class MicrosoftDistributions extends JavaBase { if (this.architecture !== 'x64' && this.architecture !== 'aarch64') { throw new Error(`Unsupported architecture: ${this.architecture}`); } + + if (!this.stable) { + throw new Error('Early access versions are not supported'); + } + const availableVersionsRaw = await this.getAvailableVersions(); const opts = this.getPlatformOption();