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 2fb264a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 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.

6 changes: 3 additions & 3 deletions src/features/check-for-updates.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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'
'A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee01177dd12d'
)
return
}
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 2fb264a

Please sign in to comment.