Skip to content

Commit e41c467

Browse files
add fix
1 parent 7d780a7 commit e41c467

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dist/setup/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103204,13 +103204,13 @@ class JavaBase {
103204103204
};
103205103205
}
103206103206
setJavaDefault(version, toolPath) {
103207-
const semVersion = semver_1.default.coerce(version);
103207+
const majorVerssion = version.split('.')[0];
103208103208
core.exportVariable('JAVA_HOME', toolPath);
103209103209
core.addPath(path_1.default.join(toolPath, 'bin'));
103210103210
core.setOutput('distribution', this.distribution);
103211103211
core.setOutput('path', toolPath);
103212103212
core.setOutput('version', version);
103213-
core.exportVariable(`JAVA_HOME_${semVersion.major.toString().toUpperCase()}`, toolPath);
103213+
core.exportVariable(`JAVA_HOME_${majorVerssion}`, toolPath);
103214103214
}
103215103215
}
103216103216
exports.JavaBase = JavaBase;

src/distributions/base-installer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ export abstract class JavaBase {
142142
}
143143

144144
protected setJavaDefault(version: string, toolPath: string) {
145-
const semVersion = semver.coerce(version);
145+
const majorVerssion = version.split('.')[0];
146146
core.exportVariable('JAVA_HOME', toolPath);
147147
core.addPath(path.join(toolPath, 'bin'));
148148
core.setOutput('distribution', this.distribution);
149149
core.setOutput('path', toolPath);
150150
core.setOutput('version', version);
151-
core.exportVariable(`JAVA_HOME_${semVersion!.major!.toString().toUpperCase()}`, toolPath);
151+
core.exportVariable(`JAVA_HOME_${majorVerssion}`, toolPath);
152152
}
153153
}

0 commit comments

Comments
 (0)