Skip to content

Commit dbbeb65

Browse files
Sync eng/common directory with azure-sdk-tools for PR 10482 (#45163)
* Properly handle error for case where no issue (pr) is found for specified commit * Use logInfo in various places * Change LogWarning to LogInfo --------- Co-authored-by: Chidozie Ononiwu <[email protected]>
1 parent 5801686 commit dbbeb65

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

eng/common/scripts/Helpers/ApiView-Helpers.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ function Set-ApiViewCommentForRelatedIssues {
132132
try {
133133
$issuesForCommit = Search-GitHubIssues -CommitHash $HeadCommitish
134134
if ($issuesForCommit.items.Count -eq 0) {
135-
LogError "No issues found for commit: $HeadCommitish"
136-
exit 1
135+
LogInfo "No issues found for commit: $HeadCommitish"
136+
Write-Host "##vso[task.complete result=SucceededWithIssues;]DONE"
137+
exit 0
137138
}
138139
} catch {
139140
LogError "No issues found for commit: $HeadCommitish"
@@ -169,8 +170,9 @@ function Set-ApiViewCommentForPR {
169170
$commentText += "## API Change Check"
170171
try {
171172
$response = Invoke-WebRequest -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3
173+
LogInfo "OperationId: $($response.Headers['X-Operation-Id'])"
172174
if ($response.StatusCode -ne 200) {
173-
LogWarning "API changes are not detected in this pull request."
175+
LogInfo "API changes are not detected in this pull request."
174176
exit 0
175177
}
176178
else {

0 commit comments

Comments
 (0)