Update APIView Helpers (#6500)
Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
This commit is contained in:
parent
19f1aa4879
commit
a9d94e3084
@ -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{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user