diff --git a/.github/actions/send-slack-notification/action.yml b/.github/actions/send-slack-notification/action.yml index 53ec310..2a8790c 100644 --- a/.github/actions/send-slack-notification/action.yml +++ b/.github/actions/send-slack-notification/action.yml @@ -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 }}" diff --git a/.github/workflows/get-xamarin-versions.yml b/.github/workflows/get-xamarin-versions.yml index 3021f8d..13fb5c8 100644 --- a/.github/workflows/get-xamarin-versions.yml +++ b/.github/workflows/get-xamarin-versions.yml @@ -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 diff --git a/get-new-tool-versions/send-slack-notification.ps1 b/get-new-tool-versions/send-slack-notification.ps1 index 3c0f516..5dce061 100644 --- a/get-new-tool-versions/send-slack-notification.ps1 +++ b/get-new-tool-versions/send-slack-notification.ps1 @@ -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"