mirror of
https://gitea.com/actions/setup-java.git
synced 2025-04-08 00:09:38 +00:00
Dont fail if jdkFile not set until checking cache
This commit is contained in:
@ -46,6 +46,9 @@ function getJava(version, arch, jdkFile) {
|
||||
core.debug(`Tool found in cache ${toolPath}`);
|
||||
}
|
||||
else {
|
||||
if (!jdkFile) {
|
||||
throw new Error(`Failed to find Java ${version} in the cache. Please specify a valid jdk file to install from instead.`);
|
||||
}
|
||||
core.debug('Retrieving Jdk from local path');
|
||||
const compressedFileExtension = getFileEnding(jdkFile);
|
||||
let tempDir = path.join(tempDirectory, 'temp_' + Math.floor(Math.random() * 2000000000));
|
||||
|
@ -23,7 +23,7 @@ function run() {
|
||||
try {
|
||||
const version = core.getInput('version', { required: true });
|
||||
const arch = core.getInput('architecture', { required: true });
|
||||
const jdkFile = core.getInput('jdkFile', { required: true });
|
||||
const jdkFile = core.getInput('jdkFile', { required: false }) || '';
|
||||
yield installer.getJava(version, arch, jdkFile);
|
||||
const matchersPath = path.join(__dirname, '..', '.github');
|
||||
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
|
||||
|
Reference in New Issue
Block a user