Skip to content

Sync eng/common directory with azure-sdk-tools for PR 10857 #6624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/common/scripts/Helpers/ApiView-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function Set-ApiViewCommentForRelatedIssues {
. ${PSScriptRoot}\..\common.ps1
$issuesForCommit = $null
try {
$issuesForCommit = Search-GitHubIssues -CommitHash $HeadCommitish
$issuesForCommit = Search-GitHubIssues -CommitHash $HeadCommitish -AuthToken $AuthToken
if ($issuesForCommit.items.Count -eq 0) {
LogInfo "No issues found for commit: $HeadCommitish"
Write-Host "##vso[task.complete result=SucceededWithIssues;]DONE"
Expand Down
17 changes: 11 additions & 6 deletions eng/common/scripts/Invoke-GitHubAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,17 @@ function Search-GitHubIssues {
[ValidateNotNullOrEmpty()]
[Parameter(Mandatory = $true)]
$CommitHash,
$State="open"
$State="open",
$AuthToken
)
$uri = "https://api.github.com/search/issues?q=sha:$CommitHash+state:$State"

return Invoke-RestMethod `
-Method GET `
-Uri $uri `
-MaximumRetryCount 3
$params = @{
Method = 'GET'
Uri = $uri
MaximumRetryCount = 3
}
if ($AuthToken) {
$params.Headers = Get-GitHubApiHeaders -token $AuthToken
}
return Invoke-RestMethod @params
}
Loading