Sync eng/common directory with azure-sdk-tools for PR 2177 (#3016)
* Create an issue template * rename the function * Add description * Update eng/common/scripts/Invoke-GitHubAPI.ps1 Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com> Co-authored-by: Sima Zhu <sizhu@microsoft.com> Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
This commit is contained in:
parent
041feefd67
commit
fbe38f7fb3
@ -157,6 +157,36 @@ function New-GitHubPullRequest {
|
||||
-MaximumRetryCount 3
|
||||
}
|
||||
|
||||
function New-GitHubIssue {
|
||||
param (
|
||||
[Parameter(Mandatory = $true)]
|
||||
$RepoOwner,
|
||||
[Parameter(Mandatory = $true)]
|
||||
$RepoName,
|
||||
[Parameter(Mandatory = $true)]
|
||||
$Title,
|
||||
[Parameter(Mandatory = $true)]
|
||||
$Description,
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Parameter(Mandatory = $true)]
|
||||
$AuthToken
|
||||
)
|
||||
|
||||
$uri = "$GithubAPIBaseURI/$RepoOwner/$RepoName/issues"
|
||||
|
||||
$parameters = @{
|
||||
title = $Title
|
||||
body = $Description
|
||||
}
|
||||
|
||||
return Invoke-RestMethod `
|
||||
-Method POST `
|
||||
-Body ($parameters | ConvertTo-Json) `
|
||||
-Uri $uri `
|
||||
-Headers (Get-GitHubApiHeaders -token $AuthToken) `
|
||||
-MaximumRetryCount 3
|
||||
}
|
||||
|
||||
function Add-GitHubIssueComment {
|
||||
param (
|
||||
[Parameter(Mandatory = $true)]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user