Resolving comments

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

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

@ -77,7 +77,6 @@ jobs:
- uses: ./.github/actions/send-slack-notification - uses: ./.github/actions/send-slack-notification
with: with:
url: ${{ secrets.SLACK_CHANNEL_URL }} url: ${{ secrets.SLACK_CHANNEL_URL }}
tool-name: 'Xamarin or Python' tool-name: 'Python or Xamarin'
pipeline-url: '${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}' 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 has failed stages:"
text: "The build of the Xamarin or Python detection pipeline failed :progress-error:"

@ -14,6 +14,8 @@ Optional parameter. The pipeline URL
Optional parameter. The image URL Optional parameter. The image URL
.PARAMETER Text .PARAMETER Text
Optional parameter. The message to post 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( param(
@ -25,11 +27,11 @@ param(
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[System.String]$ToolName, [System.String]$ToolName,
[Switch]$AddToToolsetFlag,
[System.String]$ToolVersion, [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 [System.String]$Text,
[Switch]$AddToToolsetFlag
) )
# Import helpers module # Import helpers module
@ -42,10 +44,11 @@ if ([string]::IsNullOrWhiteSpace($Text)) {
} else { } else {
$Text = "The following versions of '$toolName' are available to upload: $toolVersion" $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 = @" $jsonBodyMessage = @"
{ {
"blocks": [ "blocks": [

@ -1,13 +1,15 @@
<# <#
.SYNOPSIS .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 .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 ( param (
[Parameter(Mandatory)] [string] $ToolName [Parameter(Mandatory)]
[ValidateSet("Python", "Xamarin")]
[string]$ToolName
) )
if ($ToolName -eq "Python") { if ($ToolName -eq "Python") {
@ -16,8 +18,8 @@ if ($ToolName -eq "Python") {
Where-Object stable -eq $true | Where-Object stable -eq $true |
ForEach-Object {$_.version.split(".")[0,1] -join"."} | ForEach-Object {$_.version.split(".")[0,1] -join"."} |
Select-Object -Unique Select-Object -Unique
$toolsetManifestUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/toolsets/toolset-2019.json" $toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/toolsets/toolset-2019.json"
$latestExistingMinorVesion = ((Invoke-RestMethod $toolsetManifestUrl).toolcache | $latestExistingMinorVesion = ((Invoke-RestMethod $toolsetUrl).toolcache |
Where-Object {$_.name -eq "Python" -and $_.arch -eq "x64"}).versions | Where-Object {$_.name -eq "Python" -and $_.arch -eq "x64"}).versions |
ForEach-Object {$_.split(".")[0,1] -join"."} | ForEach-Object {$_.split(".")[0,1] -join"."} |
Select-Object -Last 1 Select-Object -Last 1
@ -28,8 +30,8 @@ if ($ToolName -eq "Xamarin") {
$xamarinReleases = (Invoke-RestMethod "http://aka.ms/manifest/stable").items $xamarinReleases = (Invoke-RestMethod "http://aka.ms/manifest/stable").items
$xamarinProducts = @('Mono Framework', 'Xamarin.Android', 'Xamarin.iOS', 'Xamarin.Mac') $xamarinProducts = @('Mono Framework', 'Xamarin.Android', 'Xamarin.iOS', 'Xamarin.Mac')
$filteredReleases = $xamarinReleases | Where-Object {$_.name -in $xamarinProducts} | Sort-Object name | Select-Object name, version $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" $toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/macos/toolsets/toolset-11.json"
$uploadedReleases = (Invoke-RestMethod $toolsetManifestUrl).xamarin $uploadedReleases = (Invoke-RestMethod $toolsetUrl).xamarin
$releasesOnImage = @{ $releasesOnImage = @{
'Mono Framework' = $uploadedReleases.'mono-versions' 'Mono Framework' = $uploadedReleases.'mono-versions'
'Xamarin.Android' = $uploadedReleases.'android-versions' 'Xamarin.Android' = $uploadedReleases.'android-versions'

Loading…
Cancel
Save