mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 18:06:45 +00:00
retry logic
This commit is contained in:
parent
7bad438e84
commit
5162a56729
2 changed files with 26 additions and 4 deletions
15
dist/setup/index.js
vendored
15
dist/setup/index.js
vendored
|
@ -105076,8 +105076,16 @@ function run() {
|
||||||
yield installVersion(stringVersion);
|
yield installVersion(stringVersion);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.info(`${stringVersion} not found`);
|
core.debug(`${error.toString()}`);
|
||||||
throw new Error("some err");
|
try {
|
||||||
|
const majorMinorVersion = getHigherVersion(stringVersion);
|
||||||
|
yield installVersion(majorMinorVersion);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
core.debug(`${error.toString()}`);
|
||||||
|
const majorVersion = getHigherVersion(stringVersion);
|
||||||
|
yield installVersion(majorVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const [index, version] of versions.entries()) {
|
for (const [index, version] of versions.entries()) {
|
||||||
|
@ -105112,6 +105120,9 @@ function run() {
|
||||||
core.info('');
|
core.info('');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function getHigherVersion(version) {
|
||||||
|
return version.substring(0, version.lastIndexOf("."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|
|
@ -42,8 +42,15 @@ async function run() {
|
||||||
try {
|
try {
|
||||||
await installVersion(stringVersion)
|
await installVersion(stringVersion)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.info(`${stringVersion} not found`)
|
core.debug(`${error.toString()}`)
|
||||||
throw new Error("some err")
|
try {
|
||||||
|
const majorMinorVersion = getHigherVersion(stringVersion)
|
||||||
|
await installVersion(majorMinorVersion)
|
||||||
|
} catch (error) {
|
||||||
|
core.debug(`${error.toString()}`)
|
||||||
|
const majorVersion = getHigherVersion(stringVersion)
|
||||||
|
await installVersion(majorVersion)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,6 +94,10 @@ async function run() {
|
||||||
core.info(` Path: ${result.path}`);
|
core.info(` Path: ${result.path}`);
|
||||||
core.info('');
|
core.info('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getHigherVersion(version: string) {
|
||||||
|
return version.substring(0, version.lastIndexOf("."))
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue