Flag for notification for adding new version to toolset

pull/41/head
Maksim Shilov 4 years ago
parent 91a00b27a0
commit eb53e302f8

@ -8,6 +8,9 @@ inputs:
required: true
description: 'Name of a tool to send notification for. Like Xamarin or Python'
default: 'Xamarin'
add-to-toolset-flag:
required: false
description: 'Flag to use notification for adding new versions to toolset'
tool-version:
required: false
description: 'New versions of a tool'
@ -32,4 +35,5 @@ runs:
-ToolVersion "${{ inputs.tool-version }}" `
-PipelineUrl "${{ inputs.pipeline-url }}" `
-ImageUrl "${{ inputs.image-url }}" `
-Text "${{ inputs.text }}"
-Text "${{ inputs.text }}" `
"${{ inputs.add-to-toolset-flag }}"

@ -36,6 +36,7 @@ jobs:
tool-name: 'Xamarin'
tool-version: ${{ needs.find-new-xamarin-versions.outputs.versions-output }}
image-url: 'https://avatars.githubusercontent.com/u/790012?s=200&v=4'
add-to-toolset-flag: '-AddToToolsetFlag'
find-new-python-versions:
name: Searching for new Python versions
@ -64,6 +65,7 @@ jobs:
tool-name: 'Python'
tool-version: ${{ needs.find-new-python-versions.outputs.versions-output }}
image-url: 'https://www.python.org/static/community_logos/python-powered-h-100x130.png'
add-to-toolset-flag: '-AddToToolsetFlag'
check_build:
name: Check build for failures

@ -25,6 +25,7 @@ param(
[ValidateNotNullOrEmpty()]
[System.String]$ToolName,
[Switch]$AddToToolsetFlag,
[System.String]$ToolVersion,
[System.String]$PipelineUrl,
[System.String]$ImageUrl = 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png',
@ -36,7 +37,7 @@ Import-Module $PSScriptRoot/helpers.psm1 -DisableNameChecking
# Create JSON body
if ([string]::IsNullOrWhiteSpace($Text)) {
if ($toolName -in ("Xamarin", "Python")) {
if ($AddToToolsetFlag) {
$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"

Loading…
Cancel
Save