Sync eng/common directory with azure-sdk-tools for PR 10482 (#6548)

* 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 <chononiw@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-04-29 12:25:29 -07:00 committed by GitHub
parent e38701682a
commit 60c9a70a99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,8 +132,9 @@ function Set-ApiViewCommentForRelatedIssues {
try {
$issuesForCommit = Search-GitHubIssues -CommitHash $HeadCommitish
if ($issuesForCommit.items.Count -eq 0) {
LogError "No issues found for commit: $HeadCommitish"
exit 1
LogInfo "No issues found for commit: $HeadCommitish"
Write-Host "##vso[task.complete result=SucceededWithIssues;]DONE"
exit 0
}
} catch {
LogError "No issues found for commit: $HeadCommitish"
@ -169,8 +170,9 @@ function Set-ApiViewCommentForPR {
$commentText += "## API Change Check"
try {
$response = Invoke-WebRequest -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3
LogInfo "OperationId: $($response.Headers['X-Operation-Id'])"
if ($response.StatusCode -ne 200) {
LogWarning "API changes are not detected in this pull request."
LogInfo "API changes are not detected in this pull request."
exit 0
}
else {