File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,36 @@ function New-GitHubPullRequest {
157157 - MaximumRetryCount 3
158158}
159159
160+ function New-GitHubIssue {
161+ param (
162+ [Parameter (Mandatory = $true )]
163+ $RepoOwner ,
164+ [Parameter (Mandatory = $true )]
165+ $RepoName ,
166+ [Parameter (Mandatory = $true )]
167+ $Title ,
168+ [Parameter (Mandatory = $true )]
169+ $Description ,
170+ [ValidateNotNullOrEmpty ()]
171+ [Parameter (Mandatory = $true )]
172+ $AuthToken
173+ )
174+
175+ $uri = " $GithubAPIBaseURI /$RepoOwner /$RepoName /issues"
176+
177+ $parameters = @ {
178+ title = $Title
179+ body = $Description
180+ }
181+
182+ return Invoke-RestMethod `
183+ - Method POST `
184+ - Body ($parameters | ConvertTo-Json ) `
185+ - Uri $uri `
186+ - Headers (Get-GitHubApiHeaders - token $AuthToken ) `
187+ - MaximumRetryCount 3
188+ }
189+
160190function Add-GitHubIssueComment {
161191 param (
162192 [Parameter (Mandatory = $true )]
You can’t perform that action at this time.
0 commit comments