Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ jobs:
FEATURES=""
FIXES=""
BREAKING=""
OTHER=""
CONTRIBUTORS=""

while IFS='|' read -r hash subject author; do
[ -z "$hash" ] && continue

# Extract commit type and scope
if [[ $subject =~ ^([a-z]+)(\(([^)]+)\))?!?:\ (.+)$ ]]; then
type="${BASH_REMATCH[1]}"
Expand All @@ -198,6 +201,7 @@ jobs:
fix)
FIXES="${FIXES}- $entry\n"
;;
# Other conventional types (chore, docs, refactor, etc.) are intentionally excluded
esac

# Check for breaking changes
Expand All @@ -208,6 +212,13 @@ jobs:
fi
BREAKING="${BREAKING}- $breaking_desc\n"
fi
else
# Non-conventional commit - add to Other Changes
# Clean up the subject (remove quotes if present)
clean_subject=$(echo "$subject" | sed 's/^"//;s/"$//')
if [ -n "$clean_subject" ]; then
OTHER="${OTHER}- $clean_subject\n"
fi
fi

# Collect unique contributors
Expand Down Expand Up @@ -243,6 +254,11 @@ jobs:
CHANGELOG="${CHANGELOG}### πŸ› Bug Fixes\n\n${FIXES}\n"
fi

# Add other changes (non-feat/fix conventional commits and non-conventional commits)
if [ -n "$OTHER" ]; then
CHANGELOG="${CHANGELOG}### πŸ“¦ Other Changes\n\n${OTHER}\n"
fi

# Add manual changelog if provided
if [ -n "${{ inputs.manual_changelog }}" ]; then
CHANGELOG="${CHANGELOG}### πŸ“ Additional Changes\n\n${{ inputs.manual_changelog }}\n\n"
Expand All @@ -254,7 +270,7 @@ jobs:
fi

# If no changelog content, add placeholder
if [ -z "$FEATURES" ] && [ -z "$FIXES" ] && [ -z "$BREAKING" ] && [ -z "${{ inputs.manual_changelog }}" ]; then
if [ -z "$FEATURES" ] && [ -z "$FIXES" ] && [ -z "$BREAKING" ] && [ -z "$OTHER" ] && [ -z "${{ inputs.manual_changelog }}" ]; then
CHANGELOG="${CHANGELOG}Minor updates and improvements.\n"
fi

Expand Down Expand Up @@ -345,6 +361,16 @@ jobs:
fi
fi

# Extract other changes (non-conventional commits)
if echo "$CHANGELOG" | grep -q "### πŸ“¦ Other Changes"; then
OTHERS=$(echo "$CHANGELOG" | sed -n '/### πŸ“¦ Other Changes/,/###/p' | grep "^- " | sed 's/^- /- /' || true)
if [ -n "$OTHERS" ]; then
while IFS= read -r line; do
CHANGE_ENTRY="${CHANGE_ENTRY}${line}\n"
done <<< "$OTHERS"
fi
fi

# Add manual changelog entries
if [ -n "${{ inputs.manual_changelog }}" ]; then
CHANGE_ENTRY="${CHANGE_ENTRY}${{ inputs.manual_changelog }}\n"
Expand Down
Loading