mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-13 13:16:52 +00:00
update
This commit is contained in:
@@ -23,29 +23,30 @@ param(
|
|||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[System.String]$ToolName,
|
[System.String]$ToolName,
|
||||||
|
|
||||||
# [Parameter(Mandatory)]
|
|
||||||
# [ValidateNotNullOrEmpty()]
|
|
||||||
# [System.String]$ToolVersion,
|
|
||||||
|
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[System.String]$Message,
|
[System.String]$ToolVersion,
|
||||||
|
|
||||||
[System.String]$PipelineUrl,
|
[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 helpers module
|
||||||
Import-Module $PSScriptRoot/helpers.psm1 -DisableNameChecking
|
Import-Module $PSScriptRoot/helpers.psm1 -DisableNameChecking
|
||||||
|
|
||||||
# Create JSON body
|
# Create JSON body
|
||||||
if ($toolName -eq "Xamarin") {
|
if ([string]::IsNullOrWhiteSpace($Text)) {
|
||||||
$text = "The following versions of '$toolName' are available, consider adding them to toolset: $toolVersion"
|
if ($toolName -eq "Xamarin") {
|
||||||
|
$text = "The following versions of '$toolName' are available, consider adding them to toolset: $toolVersion"
|
||||||
|
} else {
|
||||||
|
$text = "The following versions of '$toolName' are available to upload: $toolVersion"
|
||||||
|
}
|
||||||
|
if (-not ([string]::IsNullOrWhiteSpace($PipelineUrl))) {
|
||||||
|
$text += "\nLink to the pipeline: $pipelineUrl"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$text = "The following versions of '$toolName' are available to upload: $toolVersion"
|
$text = $Text
|
||||||
}
|
|
||||||
if (-not ([string]::IsNullOrWhiteSpace($PipelineUrl))) {
|
|
||||||
$text += "\nLink to the pipeline: $pipelineUrl"
|
|
||||||
}
|
}
|
||||||
$jsonBodyMessage = @"
|
$jsonBodyMessage = @"
|
||||||
{
|
{
|
||||||
@@ -54,7 +55,7 @@ $jsonBodyMessage = @"
|
|||||||
"type": "section",
|
"type": "section",
|
||||||
"text": {
|
"text": {
|
||||||
"type": "mrkdwn",
|
"type": "mrkdwn",
|
||||||
"text": "$Message"
|
"text": "$text"
|
||||||
},
|
},
|
||||||
"accessory": {
|
"accessory": {
|
||||||
"type": "image",
|
"type": "image",
|
||||||
|
|||||||
Reference in New Issue
Block a user