Skip to content

Commit 655cb05

Browse files
committed
Add comment explaining why the environment variable should be normalized
1 parent 81bfa64 commit 655cb05

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

dist/index.js

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

8989
let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch;
90+
// For portability reasons environment variables should only consist of
91+
// uppercase letters, digits, and the underscore. Therefore we convert
92+
// the extendedJavaHome variable to upper case and replace '.' symbols and
93+
// any other non-alphanumeric characters with an underscore.
9094
extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_');
9195
core.exportVariable('JAVA_HOME', toolPath);
9296
core.exportVariable(extendedJavaHome, toolPath);

0 commit comments

Comments
 (0)