mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-10 03:13:23 +00:00
move to the get-new-tool-versions folder
This commit is contained in:
@@ -70,4 +70,43 @@ function Skip-ExistingVersions {
|
||||
)
|
||||
|
||||
return $VersionsFromDist | Where-Object { $VersionsFromManifest -notcontains $_ }
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sending messages using Incoming Webhooks
|
||||
https://api.slack.com/messaging/webhooks
|
||||
#>
|
||||
|
||||
function Send-SlackPostMessageIncomingWebHook
|
||||
{
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[System.Uri]$Uri,
|
||||
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[System.Object]$Body
|
||||
)
|
||||
|
||||
try
|
||||
{
|
||||
$response = Invoke-RestMethod -Uri $uri -Method POST -Body $body -ErrorAction Stop
|
||||
if ($response -eq 'ok')
|
||||
{
|
||||
return $response
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "##vso[task.LogIssue type=error;] Something went wrong. Response is '$response'"
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "##vso[task.LogIssue type=error;] Slack send post message failed: '$_'"
|
||||
}
|
||||
|
||||
Write-Host "##vso[task.complete result=Failed;]"
|
||||
exit 1
|
||||
}
|
||||
@@ -35,7 +35,7 @@ param(
|
||||
)
|
||||
|
||||
# Import helpers module
|
||||
Import-Module $PSScriptRoot/slack.helpers.psm1 -DisableNameChecking
|
||||
Import-Module $PSScriptRoot/helpers.psm1 -DisableNameChecking
|
||||
|
||||
# Create JSON body
|
||||
$text = "The following versions of '$toolName' are available to upload: $toolVersion\nLink to the pipeline: $pipelineUrl"
|
||||
@@ -1,38 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sending messages using Incoming Webhooks
|
||||
https://api.slack.com/messaging/webhooks
|
||||
#>
|
||||
|
||||
function Send-SlackPostMessageIncomingWebHook
|
||||
{
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[System.Uri]$Uri,
|
||||
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[System.Object]$Body
|
||||
)
|
||||
|
||||
try
|
||||
{
|
||||
$response = Invoke-RestMethod -Uri $uri -Method POST -Body $body -ErrorAction Stop
|
||||
if ($response -eq 'ok')
|
||||
{
|
||||
return $response
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "##vso[task.LogIssue type=error;] Something went wrong. Response is '$response'"
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "##vso[task.LogIssue type=error;] Slack send post message failed: '$_'"
|
||||
}
|
||||
|
||||
Write-Host "##vso[task.complete result=Failed;]"
|
||||
exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user