mirror of
https://github.com/cmderdev/cmder.git
synced 2025-12-16 18:51:37 +08:00
Fix single dependency variable initialization to prevent CI failures
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
This commit is contained in:
11
.github/workflows/vendor.yml
vendored
11
.github/workflows/vendor.yml
vendored
@@ -51,12 +51,15 @@ jobs:
|
|||||||
$singleDepName = ""
|
$singleDepName = ""
|
||||||
$singleDepOldVersion = ""
|
$singleDepOldVersion = ""
|
||||||
$singleDepNewVersion = ""
|
$singleDepNewVersion = ""
|
||||||
|
$updatedCount = 0
|
||||||
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) {
|
||||||
$repoUrl = ($repoUrl = $s.Url.Replace("/archive/", "/releases/")).Substring(0, $repoUrl.IndexOf("/releases/")) + "/releases"
|
$repoUrl = ($repoUrl = $s.Url.Replace("/archive/", "/releases/")).Substring(0, $repoUrl.IndexOf("/releases/")) + "/releases"
|
||||||
|
|
||||||
# Store single dependency info for messages
|
$updatedCount++
|
||||||
|
|
||||||
|
# Store single dependency info for messages (only if this is the only update)
|
||||||
if ($count -eq 1) {
|
if ($count -eq 1) {
|
||||||
$singleDepName = $s.name
|
$singleDepName = $s.name
|
||||||
$singleDepOldVersion = $oldVersion
|
$singleDepOldVersion = $oldVersion
|
||||||
@@ -119,6 +122,12 @@ jobs:
|
|||||||
}
|
}
|
||||||
if ($count -eq 0) { return }
|
if ($count -eq 0) { return }
|
||||||
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
|
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
|
||||||
|
# Ensure single dependency variables are set (use placeholder if empty)
|
||||||
|
if ([string]::IsNullOrEmpty($singleDepName)) {
|
||||||
|
$singleDepName = "dependency"
|
||||||
|
$singleDepOldVersion = "unknown"
|
||||||
|
$singleDepNewVersion = "unknown"
|
||||||
|
}
|
||||||
Set-GHVariable -Name SINGLE_DEP_NAME -Value $singleDepName
|
Set-GHVariable -Name SINGLE_DEP_NAME -Value $singleDepName
|
||||||
Set-GHVariable -Name SINGLE_DEP_OLD_VERSION -Value $singleDepOldVersion
|
Set-GHVariable -Name SINGLE_DEP_OLD_VERSION -Value $singleDepOldVersion
|
||||||
Set-GHVariable -Name SINGLE_DEP_NEW_VERSION -Value $singleDepNewVersion
|
Set-GHVariable -Name SINGLE_DEP_NEW_VERSION -Value $singleDepNewVersion
|
||||||
|
|||||||
Reference in New Issue
Block a user