Skip to content

Commit 581daab

Browse files
committed
fix: Add OriginalTag parameter for post-update script validation
1 parent 0bd595f commit 581daab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

updater/scripts/update-dependency.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ param(
1616
[string] $GhTitlePattern = '',
1717
# Specific version - if passed, no discovery is performed and the version is set directly
1818
[string] $Tag = '',
19+
# Tag that the dependency was before update - should be only passed if $Tag is set. Necessary for PostUpdateScript.
20+
[string] $OriginalTag = '',
1921
# Optional post-update script to run after successful dependency update
2022
# The script receives the original and new version as arguments
2123
[string] $PostUpdateScript = ''
@@ -134,6 +136,8 @@ if (-not $isSubmodule) {
134136
}
135137

136138
if ("$Tag" -eq '') {
139+
$OriginalTag | Should -Be ''
140+
137141
if ($isSubmodule) {
138142
git submodule update --init --no-fetch --single-branch $Path
139143
Push-Location $Path
@@ -250,11 +254,10 @@ if ("$Tag" -eq '') {
250254
}
251255

252256
$Tag = $latestTag
257+
} else {
258+
$OriginalTag | Should -Not -Be ''
253259
}
254260

255-
$originalTagForPostUpdate = if ($originalTag) { $originalTag } else { '' }
256-
$newTagForPostUpdate = $Tag
257-
258261
if ($isSubmodule) {
259262
Write-Host "Updating submodule $Path to $Tag"
260263
Push-Location $Path

0 commit comments

Comments
 (0)