mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-10 11:41:23 +00:00
Update CreateWorkflowDispatch method
This commit is contained in:
@@ -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
|
|
||||||
} | ConvertTo-Json
|
|
||||||
|
|
||||||
$this.InvokeRestMethod($url, 'POST', $null, $body)
|
if ($Inputs) {
|
||||||
|
$body.inputs = $Inputs
|
||||||
|
}
|
||||||
|
|
||||||
|
$jsonBody = $body | ConvertTo-Json
|
||||||
|
|
||||||
|
$this.InvokeRestMethod($url, 'POST', $null, $jsonBody)
|
||||||
}
|
}
|
||||||
|
|
||||||
[string] hidden BuildUrl([string]$Url, [string]$RequestParams) {
|
[string] hidden BuildUrl([string]$Url, [string]$RequestParams) {
|
||||||
|
|||||||
Reference in New Issue
Block a user