diff --git a/eng/common/scripts/Helpers/Metadata-Helpers.ps1 b/eng/common/scripts/Helpers/Metadata-Helpers.ps1 index 63deb6b057e7e..8891837a9f8a1 100644 --- a/eng/common/scripts/Helpers/Metadata-Helpers.ps1 +++ b/eng/common/scripts/Helpers/Metadata-Helpers.ps1 @@ -30,7 +30,7 @@ function GetMsAliasFromGithub ($TenantId, $ClientId, $ClientSecret, $GithubUser) $opsAuthToken = Generate-AadToken -TenantId $TenantId -ClientId $ClientId -ClientSecret $ClientSecret $Headers["Authorization"] = "Bearer $opsAuthToken" Write-Host "Fetching aad identity for github user: $GithubUser" - $resp = Invoke-RestMethod $OpensourceAPIBaseURI -Method 'GET' -Headers $Headers + $resp = Invoke-RestMethod $OpensourceAPIBaseURI -Method 'GET' -Headers $Headers -MaximumRetryCount 3 } catch { Write-Warning $_ diff --git a/eng/common/scripts/Update-DocsMsMetadata.ps1 b/eng/common/scripts/Update-DocsMsMetadata.ps1 index 6d887157926ec..ed9dfe55c9f90 100644 --- a/eng/common/scripts/Update-DocsMsMetadata.ps1 +++ b/eng/common/scripts/Update-DocsMsMetadata.ps1 @@ -180,9 +180,12 @@ function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation, $packageInfo) } # Copy package info file to the docs repo + $docsMsMetadata = &$GetDocsMsMetadataForPackageFn $packageInfo + $readMePath = $docsMsMetadata.LatestReadMeLocation $metadataMoniker = 'latest' - if ($originalVersion.IsPrerelease) { + if ($originalVersion -and $originalVersion.IsPrerelease) { $metadataMoniker = 'preview' + $readMePath = $docsMsMetadata.PreviewReadMeLocation } $packageMetadataName = Split-Path $packageInfoJsonLocation -Leaf $packageInfoLocation = Join-Path $DocRepoLocation "metadata/$metadataMoniker" @@ -203,11 +206,6 @@ function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation, $packageInfo) if ($readmeContent) { $outputReadmeContent = GetAdjustedReadmeContent $readmeContent $packageInfo $packageMetadata } - $docsMsMetadata = &$GetDocsMsMetadataForPackageFn $packageInfo - $readMePath = $docsMsMetadata.LatestReadMeLocation - if ($originalVersion.IsPrerelease) { - $readMePath = $docsMsMetadata.PreviewReadMeLocation - } $suffix = $docsMsMetadata.Suffix $readMeName = "$($docsMsMetadata.DocsMsReadMeName.ToLower())-readme${suffix}.md"