use a table for message description

This commit is contained in:
David Refoua 2022-10-17 21:51:35 +03:30
parent 3f88112d22
commit 129c2971c7

View File

@ -34,21 +34,25 @@ jobs:
Set-GHVariable -Name COUNT_UPDATED -Value $count Set-GHVariable -Name COUNT_UPDATED -Value $count
$newVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json) $newVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json)
$listUpdated = "" $listUpdated = ""
$updateMessage = "" $updateMessage = "| Name | Old Version | New Version |`n| :--- | ---- | ---- |`n"
foreach ($s in $newVersion) { foreach ($s in $newVersion) {
$oldVersion = ($currentVersion | Where-Object {$_.name -eq $s.name}).version $oldVersion = ($currentVersion | Where-Object {$_.name -eq $s.name}).version
if ($s.version -ne $oldVersion) { if ($s.version -ne $oldVersion) {
$listUpdated += "$($s.name), " $listUpdated += "$($s.name), "
$updateMessage += "- **$($s.name)** ($oldVersion → **$($s.version)**)\n" $updateMessage += "| **$($s.name)** | $oldVersion | **$($s.version)**|`n"
} }
} }
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ') Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
Set-GHVariable -Name UPDATE_MESSAGE -Value $updateMessage Set-GHVariable -Name UPDATE_MESSAGE -Value [System.Web.HTTPUtility]::UrlEncode($updateMessage)
- uses: peter-evans/create-pull-request@v4 - uses: peter-evans/create-pull-request@v4
with: with:
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies' title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'
body: '### Automatically updated `${{ env.COUNT_UPDATED }}` dependencies:\n\n${{ env.UPDATE_MESSAGE }}\n\n---\nPlease verify and then **Merge** the pull request to update.' body: |
### Automatically updated `${{ env.COUNT_UPDATED }}` dependencies:
${{ env.UPDATE_MESSAGE }}
---
Please verify and then **Merge** the pull request to update.
commit-message: 'Update vendored dependencies (${{ env.LIST_UPDATED }})' commit-message: 'Update vendored dependencies (${{ env.LIST_UPDATED }})'
branch: update-vendor branch: update-vendor
base: master base: master