Skip to content

Commit 6231ae6

Browse files
authored
patch version constructor
1 parent 789eaff commit 6231ae6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/guarantee-version-correctness.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- '*'
99
pull_request:
1010
branches: [ main, dev, dajusto/validate-release-notes-are-provided ]
11-
types: [labeled, unlabeled]
1211
paths:
1312
- '.github/workflows/guarantee-release-notes.yml'
1413
- '.github/workflows/guarantee-version-correctness.yml'
@@ -27,15 +26,14 @@ jobs:
2726
$minVersion = [Version]"1.0.0" # TBD
2827
$csprojPath = ".\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj"
2928
30-
# Parse the .csproj file to find the <Version> element
29+
# Parse the .csproj file to find the <MajorVersion> element
3130
[xml]$csproj = Get-Content -Path $csprojPath
32-
$projectVersionString = $csproj.Project.PropertyGroup.Version
33-
if (-not $projectVersionString) {
34-
Write-Error "Version tag not found in the .csproj file."
35-
exit 1
36-
}
31+
$majorVersionString = $csproj.Project.PropertyGroup.MajorVersion
32+
$minorVersionString = $csproj.Project.PropertyGroup.MinorVersion
33+
$patchVersionString = $csproj.Project.PropertyGroup.PatchVersion
34+
$version = "$majorVersionString.$minorVersionString.$patchVersionString"
3735
38-
$projectVersion = [Version]$projectVersionString
36+
$projectVersion = [Version]$version
3937
4038
# Compare the project version to the minimum required version
4139
if ($projectVersion -lt $minVersion) {

0 commit comments

Comments
 (0)