Skip to content

Commit 851bf3e

Browse files
committed
Fix the missing branch name in NuGet package version on PR merge
1 parent 6afbff7 commit 851bf3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
else {
9898
# Get the version suffix from the auto-incrementing build number. For example: '123' => 'master-00123'
9999
$revision = "{0:D5}" -f [convert]::ToInt32($env:GITHUB_RUN_NUMBER, 10)
100-
$versionSuffix = "$($env:GITHUB_HEAD_REF ?? $env:GITHUB_REF_NAME)-$revision"
100+
$versionSuffix = "$(![string]::IsNullOrEmpty($env:GITHUB_HEAD_REF) ? $env:GITHUB_HEAD_REF : $env:GITHUB_REF_NAME)-$revision"
101101
}
102102
Write-Output "Using version suffix: $versionSuffix"
103103
Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

0 commit comments

Comments
 (0)