Skip to content

Commit

Permalink
Normalize extendedJavaHome environment variable
Browse files Browse the repository at this point in the history
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 .
  • Loading branch information
Arthur Baars authored and Arthur Baars committed Jun 17, 2020
1 parent 6e1616c commit 81bfa64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/index.js

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

1 change: 1 addition & 0 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export async function getJava(
}

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

0 comments on commit 81bfa64

Please sign in to comment.