Pipeline to check that version is updated (#43)

* Pipeline to check that version is updated
This commit is contained in:
2022-08-13 00:24:54 +02:00
committed by GitHub
parent b01c09491f
commit f24eb02ca1
4 changed files with 77 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
Param(
[Parameter(Mandatory=$true)]
[string]$currentVersion,
[Parameter(Mandatory=$true)]
[string]$lastVersion
)
if ($currentVersion.StartsWith("v")){
$currentVersion = $currentVersion.Substring(1)
}
if ($lastVersion.StartsWith("v")){
$lastVersion = $lastVersion.Substring(1)
}
$isNewer = $currentVersion.CompareTo($lastVersion) -eq 1
if ($isNewer -eq $false){
throw "Version is not incremented. Current version " + $currentVersion + ". Last version " + $lastVersion
}
else{
Write-Host "Version has been incremented"
}