diff --git a/.github/workflows/vendor.yml b/.github/workflows/vendor.yml index d37034f..801f8e8 100644 --- a/.github/workflows/vendor.yml +++ b/.github/workflows/vendor.yml @@ -47,7 +47,11 @@ jobs: run: | $currentVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json) . .\scripts\update.ps1 -verbose + + # Export count of updated packages (update.ps1 is expected to set $count) + if (-not ($count)) { $count = 0 } Set-GHVariable -Name COUNT_UPDATED -Value $count + $newVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json) $listUpdated = "" $updateMessage = "| Name | Old Version | New Version |`n| :--- | :---: | :---: |`n" @@ -121,7 +125,9 @@ jobs: $updateMessage += "| $emoji **[$($s.name)]($repoUrl)** | \`$oldVersion\` | **\`$($s.version)\`** |`n" } } + if ($count -eq 0) { return } + Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ') # Set single dependency variables (they will only be used if COUNT_UPDATED is 1) # Use safe fallback values in case variables weren't set (shouldn't happen but prevents errors) @@ -137,12 +143,17 @@ jobs: $singleDepOldVersion = "" $singleDepNewVersion = "" } + Set-GHVariable -Name SINGLE_DEP_NAME -Value $singleDepName Set-GHVariable -Name SINGLE_DEP_OLD_VERSION -Value $singleDepOldVersion Set-GHVariable -Name SINGLE_DEP_NEW_VERSION -Value $singleDepNewVersion - echo "UPDATE_MESSAGE<< 0 && env.HAS_BREAKING_CHANGES != 'True' @@ -261,16 +276,17 @@ jobs: if: env.COUNT_UPDATED > 0 && (env.HAS_BREAKING_CHANGES == 'True' || env.AUTO_MERGED == 'false') shell: pwsh run: | - $summary = @( - '### 🎉 Pull Request Created' - '' - 'A pull request has been created to update the vendor dependencies.' - '' - '**Branch:** `update-vendor`' - '' - "$env:LIST_UPDATED -and "**Updated dependencies:** $env:LIST_UPDATED" -or "**Updated dependencies:**" - '' - ) + $updatedLine = if (-not [string]::IsNullOrEmpty($env:LIST_UPDATED)) { "**Updated dependencies:** $env:LIST_UPDATED" } else { "**Updated dependencies:** " } + $summary = @" + ### 🎉 Pull Request Created + + A pull request has been created to update the vendor dependencies. + + **Branch:** `update-vendor` + + $updatedLine + + "@ if ($env:HAS_BREAKING_CHANGES -eq 'True') { $summary += "> âš ī¸ **Manual review required:** This update contains major version changes."