From 7d17582fe7f3bd6c7fb10b4b0fd7985a62ede020 Mon Sep 17 00:00:00 2001 From: Barry Walker Date: Tue, 13 Jan 2026 15:49:22 -0500 Subject: [PATCH] fix: use POSIX-compatible shell syntax in version script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The multiline script runs in sh, not bash. Using sed instead of bash parameter expansion for stripping the v prefix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .woodpecker/release.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml index 30f6eaa..901c937 100644 --- a/.woodpecker/release.yml +++ b/.woodpecker/release.yml @@ -26,23 +26,24 @@ steps: - name: version image: alpine/git commands: - - apk add --no-cache bash - | # Get the latest tag or default to v0.0.0 LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") echo "Latest tag: $LATEST_TAG" - # Parse current version - VERSION=${LATEST_TAG#v} - MAJOR=$(echo $VERSION | cut -d. -f1) - MINOR=$(echo $VERSION | cut -d. -f2) - PATCH=$(echo $VERSION | cut -d. -f3) + # Parse current version (strip 'v' prefix using sed) + VERSION=$(echo "$LATEST_TAG" | sed 's/^v//') + MAJOR=$(echo "$VERSION" | cut -d. -f1) + MINOR=$(echo "$VERSION" | cut -d. -f2) + PATCH=$(echo "$VERSION" | cut -d. -f3) + + echo "Current: $MAJOR.$MINOR.$PATCH" # Get commits since last tag if [ "$LATEST_TAG" = "v0.0.0" ]; then COMMITS=$(git log --pretty=format:"%s" HEAD) else - COMMITS=$(git log --pretty=format:"%s" ${LATEST_TAG}..HEAD) + COMMITS=$(git log --pretty=format:"%s" "${LATEST_TAG}..HEAD") fi # Determine bump type from conventional commits