Skip to content

Commit

Permalink
Fix upgrade notice for JDK 20 users.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 20, 2023
1 parent 0a27862 commit 9ace57c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
48 changes: 21 additions & 27 deletions dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/features/check-for-updates.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as core from '@actions/core'

export async function checkForUpdates(
export function checkForUpdates(
graalVMVersion: string,
javaVersion: string
): Promise<void> {
): void {
if (javaVersion === '20') {
core.notice(
'A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/p/ee01177dd12d'
Expand Down
9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ async function run(): Promise<void> {
distribution.length > 0 || graalVMVersion.length == 0
let graalVMHome
if (isGraalVMforJDK17OrLater) {
if (
enableCheckForUpdates &&
(distribution === c.DISTRIBUTION_GRAALVM ||
distribution === c.DISTRIBUTION_GRAALVM_COMMUNITY)
) {
checkForUpdates(graalVMVersion, javaVersion)
}
switch (distribution) {
case c.DISTRIBUTION_GRAALVM:
graalVMHome = await graalvm.setUpGraalVMJDK(javaVersion)
Expand Down Expand Up @@ -117,7 +124,7 @@ async function run(): Promise<void> {
graalVMHome = await setUpMandrel(graalVMVersion, javaVersion)
} else {
if (enableCheckForUpdates) {
await checkForUpdates(graalVMVersion, javaVersion)
checkForUpdates(graalVMVersion, javaVersion)
}
graalVMHome = await graalvm.setUpGraalVMRelease(
gdsToken,
Expand Down

0 comments on commit 9ace57c

Please sign in to comment.