From 2b479a528c75ef316d6b0a861cbad9a309899967 Mon Sep 17 00:00:00 2001 From: Barry Walker Date: Tue, 13 Jan 2026 19:11:32 -0500 Subject: [PATCH] fix(ci): add debugging and fix shallow clone for version detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change clone depth to partial: false - Add explicit git fetch --tags --unshallow - Add extensive debugging output to diagnose version detection - Check for empty commits before pattern matching 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .woodpecker/release.yml | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml index a4c6205..003f01e 100644 --- a/.woodpecker/release.yml +++ b/.woodpecker/release.yml @@ -11,7 +11,7 @@ clone: image: woodpeckerci/plugin-git settings: lfs: false - depth: 0 # Full clone needed for version calculation + partial: false tags: true steps: @@ -19,13 +19,24 @@ steps: - name: calculate-version image: alpine commands: - - apk add --no-cache git jq + - apk add --no-cache git - | set -e + # Ensure we have all tags and history + echo "=== Fetching tags and history ===" + git fetch --tags --unshallow 2>/dev/null || git fetch --tags || true + git fetch origin main --unshallow 2>/dev/null || git fetch origin main || true + + echo "=== Git log (last 10 commits) ===" + git log --oneline -10 + + echo "=== All tags ===" + git tag -l + # Get latest tag LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - echo "Latest tag: $LATEST_TAG" + echo "=== Latest tag: $LATEST_TAG ===" # Parse current version VERSION=$(echo "$LATEST_TAG" | sed 's/^v//') @@ -41,24 +52,35 @@ steps: COMMITS=$(git log --pretty=format:"%s" "${LATEST_TAG}..HEAD") fi - echo "Commits since last tag:" + echo "=== Commits since last tag ===" echo "$COMMITS" + echo "=== End commits ===" + + # Check if COMMITS is empty + if [ -z "$COMMITS" ]; then + echo "No commits found since last tag" + echo "none" > .bump-type + exit 0 + fi # Determine bump type from conventional commits BUMP="none" # Check for breaking changes (major bump) - if echo "$COMMITS" | grep -qE "^[a-z]+(\(.+\))?!:|BREAKING CHANGE:"; then + if echo "$COMMITS" | grep -qE '^[a-z]+(\(.+\))?!:|BREAKING CHANGE:'; then BUMP="major" + echo "Found breaking change commit" # Check for features (minor bump) - elif echo "$COMMITS" | grep -qE "^feat(\(.+\))?:"; then + elif echo "$COMMITS" | grep -qE '^feat(\(.+\))?:'; then BUMP="minor" + echo "Found feat commit" # Check for fixes or other conventional commits (patch bump) - elif echo "$COMMITS" | grep -qE "^(fix|perf|refactor|build|ci|docs|style|test)(\(.+\))?:"; then + elif echo "$COMMITS" | grep -qE '^(fix|perf|refactor|build|ci|docs|style|test)(\(.+\))?:'; then BUMP="patch" + echo "Found fix/patch commit" fi - echo "Bump type: $BUMP" + echo "=== Bump type: $BUMP ===" # Exit if no version bump needed if [ "$BUMP" = "none" ]; then