File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ function Set-ApiViewCommentForRelatedIssues {
132
132
. ${PSScriptRoot} \..\common.ps1
133
133
$issuesForCommit = $null
134
134
try {
135
- $issuesForCommit = Search-GitHubIssues - CommitHash $HeadCommitish
135
+ $issuesForCommit = Search-GitHubIssues - CommitHash $HeadCommitish - AuthToken $AuthToken
136
136
if ($issuesForCommit.items.Count -eq 0 ) {
137
137
LogInfo " No issues found for commit: $HeadCommitish "
138
138
Write-Host " ##vso[task.complete result=SucceededWithIssues;]DONE"
Original file line number Diff line number Diff line change @@ -560,12 +560,17 @@ function Search-GitHubIssues {
560
560
[ValidateNotNullOrEmpty ()]
561
561
[Parameter (Mandatory = $true )]
562
562
$CommitHash ,
563
- $State = " open"
563
+ $State = " open" ,
564
+ $AuthToken
564
565
)
565
566
$uri = " https://api.github.com/search/issues?q=sha:$CommitHash +state:$State "
566
-
567
- return Invoke-RestMethod `
568
- - Method GET `
569
- - Uri $uri `
570
- - MaximumRetryCount 3
567
+ $params = @ {
568
+ Method = ' GET'
569
+ Uri = $uri
570
+ MaximumRetryCount = 3
571
+ }
572
+ if ($AuthToken ) {
573
+ $params.Headers = Get-GitHubApiHeaders - token $AuthToken
574
+ }
575
+ return Invoke-RestMethod @params
571
576
}
You can’t perform that action at this time.
0 commit comments