mirror of
https://github.com/actions/setup-dotnet.git
synced 2026-06-05 22:47:10 +00:00
Add fallback logic
This commit is contained in:
parent
ac0b2277f9
commit
18e3bffb12
2 changed files with 19561 additions and 21793 deletions
34392
dist/index.js
vendored
34392
dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -262,7 +262,12 @@ export class DotnetCoreInstaller {
|
|||
httpClient: hc.HttpClient,
|
||||
versionParts: 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 || {};
|
||||
let releasesInfo: any[] = result['releases-index'];
|
||||
|
||||
|
|
@ -301,4 +306,7 @@ export class DotnetCoreInstaller {
|
|||
}
|
||||
|
||||
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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue