Skip to content

Commit 08ab4a9

Browse files
committed
Fix publish version output and redundant country-code pattern
The publish workflow used GitVersion's nuGetVersionV2 output, which was removed in GitVersion 6, so -p:Version came through empty and the build failed on newer SDKs (GenerateDepsFile missing AssemblyVersion). Switch to the semVer output for both build and pack. Also fix Alpha2CountryCodeAttribute: 'is not > A and < Z' parsed as '(<= A) and (< Z)' (CS9336 redundant pattern) and wrongly excluded the letters A and Z. Use 'is not (>= A and <= Z)' to reject only non-uppercase characters.
1 parent 6f14bdc commit 08ab4a9

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Build
4242
run: >
4343
dotnet build --configuration Release --no-restore
44-
-p:Version=${{ steps.version_step.outputs.nuGetVersionV2 }}
44+
-p:Version=${{ steps.version_step.outputs.semVer }}
4545
-p:AssemblyVersion=${{ steps.version_step.outputs.assemblySemVer }}
4646
-p:FileVersion=${{ steps.version_step.outputs.assemblySemFileVer }}
4747
-p:InformationalVersion=${{ steps.version_step.outputs.fullSemVer }}
@@ -53,7 +53,7 @@ jobs:
5353
run: >
5454
dotnet pack --configuration Release --no-build
5555
-o ${{ runner.temp }}/nupkgs
56-
-p:Version=${{ steps.version_step.outputs.nuGetVersionV2 }}
56+
-p:Version=${{ steps.version_step.outputs.semVer }}
5757
5858
- name: Push to GitHub Packages
5959
run: >

Internal.Common/Geo/Alpha2CountryCodeAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public sealed class Alpha2CountryCodeAttribute : ValidationAttribute
1717
if (asString.Length != 2)
1818
return new ValidationResult("Input string must be exactly 2 characters long");
1919

20-
if (asString[0] is not > 'A' and < 'Z' || asString[1] is not > 'A' and < 'Z')
20+
if (asString[0] is not (>= 'A' and <= 'Z') || asString[1] is not (>= 'A' and <= 'Z'))
2121
return new ValidationResult("Characters must be uppercase");
2222

2323
if (!Alpha2CountryCode.TryParse(asString, out var countryCode))

0 commit comments

Comments
 (0)