From 8c62a832045ed3cf7cae491e5ea1f063f21ec2cc Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 17 Aug 2021 17:03:20 +0300 Subject: [PATCH] Add CancelWorkflow method to github-api.psm1 and update get-new-tool-versions.ps1 --- get-new-tool-versions/get-new-tool-versions.ps1 | 6 +++++- github/github-api.psm1 | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/get-new-tool-versions/get-new-tool-versions.ps1 b/get-new-tool-versions/get-new-tool-versions.ps1 index 75e0353..de31ffd 100644 --- a/get-new-tool-versions/get-new-tool-versions.ps1 +++ b/get-new-tool-versions/get-new-tool-versions.ps1 @@ -29,7 +29,11 @@ if ($ToolName -eq "Xamarin") { if ($VersionsToBuild) { $availableVersions = $VersionsToBuild -join $joinChars 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 { Write-Host "There aren't versions to build" } diff --git a/github/github-api.psm1 b/github/github-api.psm1 index 3103ed0..6ba32c7 100644 --- a/github/github-api.psm1 +++ b/github/github-api.psm1 @@ -124,6 +124,11 @@ class GitHubApi } } + [void] CancelWorkflow([string]$WorkflowId) { + $url = "actions/runs/$WorkflowId/cancel" + $this.InvokeRestMethod($url, 'POST', $null, $null) + } + [object] hidden InvokeRestMethod( [string] $Url, [string] $Method,