mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-01-19 06:41:44 +07:00
Add Fallback logic
This commit is contained in:
parent
b14d641b30
commit
55695e9348
11
dist/index.js
vendored
11
dist/index.js
vendored
@ -18168,7 +18168,13 @@ class DotnetCoreInstaller {
|
|||||||
}
|
}
|
||||||
getReleasesJsonUrl(httpClient, versionParts) {
|
getReleasesJsonUrl(httpClient, versionParts) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const response = yield httpClient.getJson(DotNetCoreIndexUrl);
|
let response;
|
||||||
|
try {
|
||||||
|
response = yield httpClient.getJson(DotNetCoreIndexUrl);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
response = yield httpClient.getJson(DotnetCoreIndexFallbackUrl);
|
||||||
|
}
|
||||||
const result = response.result || {};
|
const result = response.result || {};
|
||||||
let releasesInfo = result['releases-index'];
|
let releasesInfo = result['releases-index'];
|
||||||
releasesInfo = releasesInfo.filter((info) => {
|
releasesInfo = releasesInfo.filter((info) => {
|
||||||
@ -18192,7 +18198,8 @@ class DotnetCoreInstaller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DotnetCoreInstaller = DotnetCoreInstaller;
|
exports.DotnetCoreInstaller = DotnetCoreInstaller;
|
||||||
const DotNetCoreIndexUrl = 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
|
const DotNetCoreIndexUrl = 'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json';
|
||||||
|
const DotnetCoreIndexFallbackUrl = 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -261,7 +261,12 @@ export class DotnetCoreInstaller {
|
|||||||
httpClient: hc.HttpClient,
|
httpClient: hc.HttpClient,
|
||||||
versionParts: string[]
|
versionParts: string[]
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const response = await httpClient.getJson<any>(DotNetCoreIndexUrl);
|
let response;
|
||||||
|
try {
|
||||||
|
response = await httpClient.getJson<any>(DotNetCoreIndexUrl);
|
||||||
|
} catch (error) {
|
||||||
|
response = await httpClient.getJson<any>(DotnetCoreIndexFallbackUrl);
|
||||||
|
}
|
||||||
const result = response.result || {};
|
const result = response.result || {};
|
||||||
let releasesInfo: any[] = result['releases-index'];
|
let releasesInfo: any[] = result['releases-index'];
|
||||||
|
|
||||||
@ -300,4 +305,7 @@ export class DotnetCoreInstaller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const DotNetCoreIndexUrl: string =
|
const DotNetCoreIndexUrl: string =
|
||||||
|
'https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json';
|
||||||
|
|
||||||
|
const DotnetCoreIndexFallbackUrl: string =
|
||||||
'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
|
'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
|
||||||
|
Loading…
Reference in New Issue
Block a user