Skip to content

Commit 9ab6978

Browse files
committed
fix: use sed instead of bash substitution for deb version tilde
Bash 5+ applies tilde expansion to the replacement string in ${var//-/~}, turning ~ into $HOME (/home/runner on CI). Use sed 's/-/~/g' to safely convert hyphens to tildes for Debian version formatting.
1 parent f3176bd commit 9ab6978

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,10 @@ jobs:
397397
398398
# Update debian/changelog version from release tag
399399
# Convert pre-release for Debian (~ sorts before release, so 0.13.2~beta.1 < 0.13.2)
400+
# Note: cannot use ${VERSION//-/~} because bash 5+ applies tilde expansion
401+
# to the replacement string, turning ~ into $HOME
400402
VERSION="${RELEASE_TAG#v}"
401-
DEB_VERSION="${VERSION//-/~}"
403+
DEB_VERSION=$(echo "$VERSION" | sed 's/-/~/g')
402404
sed -i "1s#([^)]*)#($DEB_VERSION-1)#" debian/changelog
403405
404406
# Build the .deb package (-d skips build dependency check since we use pre-built binary)

0 commit comments

Comments
 (0)