File tree Expand file tree Collapse file tree
tests/OpenClaw.Tray.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,16 @@ jobs:
106106 id : gitversion
107107 uses : gittools/actions/gitversion/execute@v4
108108
109+ - name : Verify tag version output
110+ if : startsWith(github.ref, 'refs/tags/v')
111+ shell : pwsh
112+ run : |
113+ $expected = "${{ github.ref_name }}" -replace '^v', ''
114+ $actual = "${{ steps.gitversion.outputs.semVer }}"
115+ if ($actual -ne $expected) {
116+ throw "GitVersion SemVer '$actual' did not match tag '$expected'."
117+ }
118+
109119 - name : Restore dependencies
110120 run : dotnet restore
111121
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ assembly-versioning-scheme: MajorMinorPatch
55branches :
66 main :
77 regex : ^(master|main)$
8- label : ' '
8+ label : alpha
99 increment : Patch
1010
1111ignore :
Original file line number Diff line number Diff line change @@ -58,6 +58,23 @@ public void ProductProjects_DoNotHardcodeReleaseVersion()
5858 string . Join ( Environment . NewLine , offenders ) ) ;
5959 }
6060
61+ [ Fact ]
62+ public void GitVersion_MainBranchPreservesAlphaReleaseTags ( )
63+ {
64+ var repoRoot = GetRepositoryRoot ( ) ;
65+ var configPath = Path . Combine ( repoRoot , "GitVersion.yml" ) ;
66+ var config = File . ReadAllText ( configPath ) ;
67+ var mainBranchMatch = Regex . Match (
68+ config ,
69+ @"(?ms)^ main:\s*$\r?\n(?<body>.*?)(?=^ \S|\z)" ,
70+ RegexOptions . CultureInvariant ) ;
71+
72+ Assert . True ( mainBranchMatch . Success , "GitVersion.yml must configure the main branch." ) ;
73+ Assert . Matches (
74+ @"(?m)^\s+label:\s*'?alpha'?\s*$" ,
75+ mainBranchMatch . Groups [ "body" ] . Value ) ;
76+ }
77+
6178 [ Fact ]
6279 public void ActiveCodeAndTests_DoNotContainStaleReleaseVersion ( )
6380 {
You can’t perform that action at this time.
0 commit comments