Skip to content

Commit b0a25bc

Browse files
Added new API to get list of github issues (Azure#25809)
Co-authored-by: Praveen Kuttappan <praveen.kuttappan@gmail.com>
1 parent ff1b96f commit b0a25bc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

eng/common/scripts/Invoke-GitHubAPI.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,33 @@ function New-GitHubIssue {
187187
-MaximumRetryCount 3
188188
}
189189

190+
function Get-GitHubIssues {
191+
param (
192+
[Parameter(Mandatory = $true)]
193+
$RepoOwner,
194+
[Parameter(Mandatory = $true)]
195+
$RepoName,
196+
$CreatedBy,
197+
[Parameter(Mandatory = $true)]
198+
$Labels,
199+
[ValidateNotNullOrEmpty()]
200+
[Parameter(Mandatory = $true)]
201+
$AuthToken
202+
)
203+
204+
$uri = "$GithubAPIBaseURI/$RepoOwner/$RepoName/issues?labels=$Labels"
205+
206+
if ($CreatedBy) {
207+
$uri += "&creator=$CreatedBy"
208+
}
209+
210+
return Invoke-RestMethod `
211+
-Method GET `
212+
-Uri $uri `
213+
-Headers (Get-GitHubApiHeaders -token $AuthToken) `
214+
-MaximumRetryCount 3
215+
}
216+
190217
function Add-GitHubIssueComment {
191218
param (
192219
[Parameter(Mandatory = $true)]

0 commit comments

Comments
 (0)