From 173b31a3ec97601922fd08e1a7306a107e50e979 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 6 Sep 2025 18:32:12 +0200 Subject: [PATCH] Truncate long branch names created by Dependabot, causing build failure --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index faaa45ca8d..a0f968ac00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,8 +85,8 @@ jobs: # Get the version suffix from the auto-incrementing build number. For example: '123' => 'master-00123' $revision = "{0:D5}" -f [convert]::ToInt32($env:GITHUB_RUN_NUMBER, 10) $branchName = ![string]::IsNullOrEmpty($env:GITHUB_HEAD_REF) ? $env:GITHUB_HEAD_REF : $env:GITHUB_REF_NAME - $safeName = $branchName.Replace('/', '-').Replace('_', '-') - $versionSuffix = "$safeName-$revision" + $safeBranchName = $($branchName -Replace '[^a-zA-Z0-9-]', '-')[0..40] -Join "" + $versionSuffix = "$safeBranchName-$revision" } Write-Output "Using version suffix: $versionSuffix" Write-Output "PACKAGE_VERSION_SUFFIX=$versionSuffix" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append