Update CreateWorkflowDispatch method

pull/14/head
MaksimZhukov 4 years ago
parent 7e2bc9a237
commit 2ea972432a

@ -62,7 +62,6 @@ function Validate-ReleaseAvailability {
Write-Host "Release was successfully created: $($createdRelease.html_url)" Write-Host "Release was successfully created: $($createdRelease.html_url)"
return return
} }
$RetryCount
$RetryCount-- $RetryCount--
Start-Sleep -Seconds $RetryIntervalSec Start-Sleep -Seconds $RetryIntervalSec

@ -103,14 +103,17 @@ class GitHubApi
return $this.InvokeRestMethod($url, 'GET', $null, $null) return $this.InvokeRestMethod($url, 'GET', $null, $null)
} }
[void] CreateWorkflowDispatch([string]$WorkflowFileName, [string]$Ref, [object]$Inputs) { [void] CreateWorkflowDispatch([string]$WorkflowFileName, [string]$Ref, [string]$Inputs) {
$url = "actions/workflows/${WorkflowFileName}/dispatches" $url = "actions/workflows/${WorkflowFileName}/dispatches"
$body = @{ $body = @{ ref = $Ref }
ref = $Ref
inputs = $Inputs if ($Inputs) {
} | ConvertTo-Json $body.inputs = $Inputs
}
$this.InvokeRestMethod($url, 'POST', $null, $body) $jsonBody = $body | ConvertTo-Json
$this.InvokeRestMethod($url, 'POST', $null, $jsonBody)
} }
[string] hidden BuildUrl([string]$Url, [string]$RequestParams) { [string] hidden BuildUrl([string]$Url, [string]$RequestParams) {

Loading…
Cancel
Save