diff --git a/eng/common/scripts/Helpers/ApiView-Helpers.ps1 b/eng/common/scripts/Helpers/ApiView-Helpers.ps1 index d84ef5dd2..e25214a93 100644 --- a/eng/common/scripts/Helpers/ApiView-Helpers.ps1 +++ b/eng/common/scripts/Helpers/ApiView-Helpers.ps1 @@ -168,8 +168,8 @@ function Set-ApiViewCommentForPR { $commentText = @() $commentText += "## API Change Check" try { - $response = Invoke-RestMethod -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3 - if ($response.Count -eq 0) { + $response = Invoke-WebRequest -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3 + if ($response.StatusCode -ne 200) { LogWarning "API changes are not detected in this pull request." $commentText += "" $commentText += "API changes are not detected in this pull request." @@ -179,10 +179,17 @@ function Set-ApiViewCommentForPR { $commentText += "" $commentText += "APIView identified API level changes in this PR and created the following API reviews" $commentText += "" - $commentText += "| Language | API Review for Package |" - $commentText += "|----------|---------|" - $response | ForEach-Object { - $commentText += "| $($_.language) | [$($_.packageName)]($($_.url)) |" + + if ($RepoName.StartsWith(("azure-sdk-for-"))) { + $response | ForEach-Object { + $commentText += "[$($_.packageName)]($($_.url))" + } + } else { + $commentText += "| Language | API Review for Package |" + $commentText += "|----------|---------|" + $response | ForEach-Object { + $commentText += "| $($_.language) | [$($_.packageName)]($($_.url)) |" + } } } } catch{