|
|
|
@ -23,22 +23,20 @@ param(
|
|
|
|
|
[ValidateNotNullOrEmpty()]
|
|
|
|
|
[System.String]$ToolName,
|
|
|
|
|
|
|
|
|
|
# [Parameter(Mandatory)]
|
|
|
|
|
# [ValidateNotNullOrEmpty()]
|
|
|
|
|
# [System.String]$ToolVersion,
|
|
|
|
|
|
|
|
|
|
[Parameter(Mandatory)]
|
|
|
|
|
[ValidateNotNullOrEmpty()]
|
|
|
|
|
[System.String]$Message,
|
|
|
|
|
[System.String]$ToolVersion,
|
|
|
|
|
|
|
|
|
|
[System.String]$PipelineUrl,
|
|
|
|
|
[System.String]$ImageUrl = 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'
|
|
|
|
|
[System.String]$ImageUrl = 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png',
|
|
|
|
|
[System.String]$Text
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Import helpers module
|
|
|
|
|
Import-Module $PSScriptRoot/helpers.psm1 -DisableNameChecking
|
|
|
|
|
|
|
|
|
|
# Create JSON body
|
|
|
|
|
if ([string]::IsNullOrWhiteSpace($Text)) {
|
|
|
|
|
if ($toolName -eq "Xamarin") {
|
|
|
|
|
$text = "The following versions of '$toolName' are available, consider adding them to toolset: $toolVersion"
|
|
|
|
|
} else {
|
|
|
|
@ -47,6 +45,9 @@ if ($toolName -eq "Xamarin") {
|
|
|
|
|
if (-not ([string]::IsNullOrWhiteSpace($PipelineUrl))) {
|
|
|
|
|
$text += "\nLink to the pipeline: $pipelineUrl"
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$text = $Text
|
|
|
|
|
}
|
|
|
|
|
$jsonBodyMessage = @"
|
|
|
|
|
{
|
|
|
|
|
"blocks": [
|
|
|
|
@ -54,7 +55,7 @@ $jsonBodyMessage = @"
|
|
|
|
|
"type": "section",
|
|
|
|
|
"text": {
|
|
|
|
|
"type": "mrkdwn",
|
|
|
|
|
"text": "$Message"
|
|
|
|
|
"text": "$text"
|
|
|
|
|
},
|
|
|
|
|
"accessory": {
|
|
|
|
|
"type": "image",
|
|
|
|
|