Skip to content

Commit d920b7d

Browse files
authored
Merge pull request actions#78 from aibaars/patch-1
Normalize extendedJavaHome environment variable
2 parents 6e1616c + 8896560 commit d920b7d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

dist/index.js

Lines changed: 6 additions & 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ export async function getJava(
8787
}
8888

8989
let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch;
90+
core.exportVariable(extendedJavaHome, toolPath); //TODO: remove for v2
91+
// For portability reasons environment variables should only consist of
92+
// uppercase letters, digits, and the underscore. Therefore we convert
93+
// the extendedJavaHome variable to upper case and replace '.' symbols and
94+
// any other non-alphanumeric characters with an underscore.
95+
extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_');
9096
core.exportVariable('JAVA_HOME', toolPath);
9197
core.exportVariable(extendedJavaHome, toolPath);
9298
core.addPath(path.join(toolPath, 'bin'));

0 commit comments

Comments
 (0)