Skip to content

Commit f0bb916

Browse files
Add an error condition for non jdk Microsoft OpenJDK build (actions#265)
1 parent d23aed3 commit f0bb916

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

dist/setup/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13889,6 +13889,9 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
1388913889
if (!this.stable) {
1389013890
throw new Error('Early access versions are not supported');
1389113891
}
13892+
if (this.packageType !== 'jdk') {
13893+
throw new Error('Microsoft Build of OpenJDK provides only the `jdk` package type');
13894+
}
1389213895
const availableVersionsRaw = yield this.getAvailableVersions();
1389313896
const opts = this.getPlatformOption();
1389413897
const availableVersions = availableVersionsRaw.map(item => ({

docs/advanced-usage.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ steps:
6565
- run: java -cp java HelloWorldApp
6666
```
6767

68+
### Microsoft
69+
```yaml
70+
steps:
71+
- uses: actions/checkout@v2
72+
- uses: actions/setup-java@v2
73+
with:
74+
distribution: 'microsoft'
75+
java-version: '11'
76+
- run: java -cp java HelloWorldApp
77+
```
78+
6879
## Installing custom Java package type
6980
```yaml
7081
steps:

src/distributions/microsoft/installer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export class MicrosoftDistributions extends JavaBase {
4545
throw new Error('Early access versions are not supported');
4646
}
4747

48+
if (this.packageType !== 'jdk') {
49+
throw new Error('Microsoft Build of OpenJDK provides only the `jdk` package type');
50+
}
51+
4852
const availableVersionsRaw = await this.getAvailableVersions();
4953

5054
const opts = this.getPlatformOption();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy