Resolving comments

pull/41/head
Maksim Shilov 4 years ago
parent 96ab07e175
commit 89a0912ffb

@ -8,9 +8,6 @@ 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'
@ -24,6 +21,9 @@ inputs:
text:
required: false
description: 'Message text'
add-to-toolset-flag:
required: false
description: 'Flag to use notification for adding new versions to toolset'
runs:
using: "composite"
steps:
@ -36,4 +36,4 @@ runs:
-PipelineUrl "${{ inputs.pipeline-url }}" `
-ImageUrl "${{ inputs.image-url }}" `
-Text "${{ inputs.text }}" `
"${{ inputs.add-to-toolset-flag }}"
${{ inputs.add-to-toolset-flag }}

@ -77,7 +77,6 @@ jobs:
- uses: ./.github/actions/send-slack-notification
with:
url: ${{ secrets.SLACK_CHANNEL_URL }}
tool-name: 'Xamarin or Python'
pipeline-url: '${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}'
image-url: 'https://avatars.githubusercontent.com/u/790012?s=200&v=4'
text: "The build of the Xamarin or Python detection pipeline failed :progress-error:"
tool-name: 'Python or Xamarin'
pipeline-url: '$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID'
text: "The build of the Xamarin or Python detection pipeline has failed stages:"

@ -14,6 +14,8 @@ Optional parameter. The pipeline URL
Optional parameter. The image URL
.PARAMETER Text
Optional parameter. The message to post
.PARAMETER AddToToolsetFlag
Optional parameter. Flag to alternate message text for adding new version of a tool to toolset notification
#>
param(
@ -25,11 +27,11 @@ 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',
[System.String]$Text
[System.String]$Text,
[Switch]$AddToToolsetFlag
)
# Import helpers module
@ -42,10 +44,11 @@ if ([string]::IsNullOrWhiteSpace($Text)) {
} else {
$Text = "The following versions of '$toolName' are available to upload: $toolVersion"
}
if (-not ([string]::IsNullOrWhiteSpace($PipelineUrl))) {
$Text += "\nLink to the pipeline: $pipelineUrl"
}
}
if (-not ([string]::IsNullOrWhiteSpace($PipelineUrl))) {
$Text += "\nLink to the pipeline: $pipelineUrl"
}
$jsonBodyMessage = @"
{
"blocks": [

@ -1,13 +1,15 @@
<#
.SYNOPSIS
Check and return list of new available tool versions
Check and return list of new available tool versions that not added to toolsets yet
.PARAMETER ToolName
Required parameter. The name of tool for which parser is available (Node, Go, Python, Xamarin)
Required parameter. The name of tool for which parser is available (Python, Xamarin)
#>
param (
[Parameter(Mandatory)] [string] $ToolName
[Parameter(Mandatory)]
[ValidateSet("Python", "Xamarin")]
[string]$ToolName
)
if ($ToolName -eq "Python") {
@ -16,8 +18,8 @@ if ($ToolName -eq "Python") {
Where-Object stable -eq $true |
ForEach-Object {$_.version.split(".")[0,1] -join"."} |
Select-Object -Unique
$toolsetManifestUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/toolsets/toolset-2019.json"
$latestExistingMinorVesion = ((Invoke-RestMethod $toolsetManifestUrl).toolcache |
$toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/toolsets/toolset-2019.json"
$latestExistingMinorVesion = ((Invoke-RestMethod $toolsetUrl).toolcache |
Where-Object {$_.name -eq "Python" -and $_.arch -eq "x64"}).versions |
ForEach-Object {$_.split(".")[0,1] -join"."} |
Select-Object -Last 1
@ -28,8 +30,8 @@ if ($ToolName -eq "Xamarin") {
$xamarinReleases = (Invoke-RestMethod "http://aka.ms/manifest/stable").items
$xamarinProducts = @('Mono Framework', 'Xamarin.Android', 'Xamarin.iOS', 'Xamarin.Mac')
$filteredReleases = $xamarinReleases | Where-Object {$_.name -in $xamarinProducts} | Sort-Object name | Select-Object name, version
$toolsetManifestUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/macos/toolsets/toolset-11.json"
$uploadedReleases = (Invoke-RestMethod $toolsetManifestUrl).xamarin
$toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/macos/toolsets/toolset-11.json"
$uploadedReleases = (Invoke-RestMethod $toolsetUrl).xamarin
$releasesOnImage = @{
'Mono Framework' = $uploadedReleases.'mono-versions'
'Xamarin.Android' = $uploadedReleases.'android-versions'

Loading…
Cancel
Save