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:
Azure SDK Bot 2021-11-01 13:40:53 -07:00 committed by GitHub
parent 041feefd67
commit fbe38f7fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)]