Use java-version (#14) · leo7/setup-java@475978b · GitHub
Skip to content

Commit 475978b

Browse files
author
Danny McCormick
authored
Use java-version (actions#14)
1 parent cbc5ae3 commit 475978b

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 3 deletions

‎action.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Setup Java environment'
22
description: 'Setup your runner with Java'
33
author: 'GitHub'
44
inputs:
5-
version:
5+
java-version:
66
description: 'The JDK version to make available on the path. Takes a whole or semver Jdk version, or 1.x syntax (e.g. 1.8 => Jdk 8.x)'
77
required: true
88
architecture:
@@ -12,6 +12,9 @@ inputs:
1212
jdkFile:
1313
description: 'Path to where the compressed JDK is located. The path could be in your source repository or a local path on the agent.'
1414
required: false
15+
# Deprecated option, do not use. Will not be supported after October 1, 2019
16+
version:
17+
description: 'Deprecated. Use java-version instead. Will not be supported after October 1, 2019'
1518
runs:
1619
using: 'node12'
1720
main: 'lib/setup-java.js'

‎lib/setup-java.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ const path = __importStar(require("path"));
2121
function run() {
2222
return __awaiter(this, void 0, void 0, function* () {
2323
try {
24-
const version = core.getInput('version', { required: true });
24+
let version = core.getInput('version');
25+
if (!version) {
26+
version = core.getInput('java-version', { required: true });
27+
}
2528
const arch = core.getInput('architecture', { required: true });
2629
const jdkFile = core.getInput('jdkFile', { required: false }) || '';
2730
yield installer.getJava(version, arch, jdkFile);

‎src/setup-java.ts‎

Lines changed: 4 additions & 1 deletion

0 commit comments

Comments
 (0)