Add CancelWorkflow method to github-api.psm1 and update get-new-tool-versions.ps1

pull/34/head
Nikita Bykov 3 years ago
parent 46a901fa87
commit 8c62a83204

@ -29,7 +29,11 @@ if ($ToolName -eq "Xamarin") {
if ($VersionsToBuild) { if ($VersionsToBuild) {
$availableVersions = $VersionsToBuild -join $joinChars $availableVersions = $VersionsToBuild -join $joinChars
Write-Host "The following versions are available to build:`n${availableVersions}" Write-Host "The following versions are available to build:`n${availableVersions}"
Write-Host "##vso[task.setvariable variable=TOOL_VERSIONS;isOutput=true]${availableVersions}" if ($ToolName -eq "Go") {
Write-Host "::set-output name=version_number::${availableVersions}"
} else {
Write-Host "##vso[task.setvariable variable=TOOL_VERSIONS;isOutput=true]${availableVersions}"
}
} else { } else {
Write-Host "There aren't versions to build" Write-Host "There aren't versions to build"
} }

@ -124,6 +124,11 @@ class GitHubApi
} }
} }
[void] CancelWorkflow([string]$WorkflowId) {
$url = "actions/runs/$WorkflowId/cancel"
$this.InvokeRestMethod($url, 'POST', $null, $null)
}
[object] hidden InvokeRestMethod( [object] hidden InvokeRestMethod(
[string] $Url, [string] $Url,
[string] $Method, [string] $Method,

Loading…
Cancel
Save