mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-10 03:13:23 +00:00
Add CancelWorkflow method to github-api.psm1 and update get-new-tool-versions.ps1
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user