Skip to content

Commit 9bdcf33

Browse files
authored
Merge pull request #1321 from json-api-dotnet/fix-github-actions-package-version
GitHub Actions: Fix the missing branch name in NuGet package version on PR merge
2 parents 6afbff7 + 851bf3e commit 9bdcf33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/build.yml

+1-1
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)