File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,23 +50,26 @@ jobs:
5050 VERSION="${VERSION#v}"
5151 echo "DEBUG: Tag push detected, using tag version: ${VERSION}"
5252 else
53- LATEST_TAG=$(git describe --tags --match "v*" --abbrev=0 2>/dev/null || echo "")
53+ LATEST_TAG=$(git describe --tags --match "v*" --abbrev=0 2>/dev/null || echo "")
5454 if [ -z "$LATEST_TAG" ]; then
55- # No tags exist yet in this repo - diff against full history instead
56- # of a synthetic "v0.0.0" ref, which would make `git log` fail.
57- BUMP_COMMITS=$(git log --format="%s %b" 2>/dev/null || echo "")
55+ # No tags exist yet in this repo - use commit subjects only.
56+ BUMP_COMMITS=$(git log --format="%s" 2>/dev/null || echo "")
5857 LATEST_TAG="v0.0.0"
5958 else
60- BUMP_COMMITS=$(git log "${LATEST_TAG}..HEAD" --format="%s %b" 2>/dev/null || echo "")
59+ # Only commit subjects are considered for versioning.
60+ BUMP_COMMITS=$(git log "${LATEST_TAG}..HEAD" --format="%s" 2>/dev/null || echo "")
6161 fi
6262
6363 VERSION=${LATEST_TAG#v}
6464 IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
6565
66- if echo "$BUMP_COMMITS" | grep -q "BREAKING CHANGE"; then
66+ echo "DEBUG: Commits considered for version bump:"
67+ printf '%s\n' "$BUMP_COMMITS"
68+
69+ if printf '%s\n' "$BUMP_COMMITS" | grep -qE '^[^:]+!:|^[^:]+:.*BREAKING CHANGE|BREAKING CHANGE'; then
6770 MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0
6871 BUMP="major"
69- elif echo "$BUMP_COMMITS" | grep -qE " ^(feat|feature|Add|Build|Enhance )(\(|:|\ )" ; then
72+ elif printf '%s\n' "$BUMP_COMMITS" | grep -qE ' ^(feat|feature)(\([^)]*\))?:[[:space:]]' ; then
7073 MINOR=$((MINOR + 1)); PATCH=0
7174 BUMP="minor"
7275 else
You can’t perform that action at this time.
0 commit comments