Skip to content

Commit 402984e

Browse files
committed
Workaround for slashes and underscores in branch names created by dependabot
1 parent ce570fc commit 402984e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ jobs:
9999
else {
100100
# Get the version suffix from the auto-incrementing build number. For example: '123' => 'master-00123'
101101
$revision = "{0:D5}" -f [convert]::ToInt32($env:GITHUB_RUN_NUMBER, 10)
102-
$versionSuffix = "$(![string]::IsNullOrEmpty($env:GITHUB_HEAD_REF) ? $env:GITHUB_HEAD_REF : $env:GITHUB_REF_NAME)-$revision"
102+
$branchName = ![string]::IsNullOrEmpty($env:GITHUB_HEAD_REF) ? $env:GITHUB_HEAD_REF : $env:GITHUB_REF_NAME
103+
$safeName = $branchName.Replace('/', '-').Replace('_', '-')
104+
$versionSuffix = "$safeName-$revision"
103105
}
104106
Write-Output "Using version suffix: $versionSuffix"
105107
Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

0 commit comments

Comments
 (0)