Skip to content

Commit 81bfa64

Browse files
committed
Normalize extendedJavaHome environment variable
The extendedJavaHome environment variable contains `.` symbols in the version. This causes the environment variable to be ignored by the action runner. It's best to replace those and other non standard symbols with and underscore. For reference: > Environment variable names used by the utilities in the Shell and Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase letters, digits, and the '_' (underscore) from the characters defined in Portable Character Set .
1 parent 6e1616c commit 81bfa64

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

dist/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/installer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export async function getJava(
8787
}
8888

8989
let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch;
90+
extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_');
9091
core.exportVariable('JAVA_HOME', toolPath);
9192
core.exportVariable(extendedJavaHome, toolPath);
9293
core.addPath(path.join(toolPath, 'bin'));

0 commit comments

Comments
 (0)