@@ -257,10 +257,56 @@ jobs:
257257 PREVIOUS_TAG=$(git describe --abbrev=0 --tags --match "v*" 2>/dev/null || echo "")
258258 if [ -z "$PREVIOUS_TAG" ]; then
259259 # First release - get all commits
260- CHANGELOG =$(git log --pretty=format:"- %s (%h)" --no-merges)
260+ COMMITS =$(git log --pretty=format:"%s (%h)|%b " --no-merges | tr '\n' ' ' )
261261 else
262262 # Get commits since previous tag
263- CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
263+ COMMITS=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"%s (%h)|%b" --no-merges | tr '\n' ' ')
264+ fi
265+
266+ # Categorize commits by conventional commit type
267+ BUGS=""
268+ FEATURES=""
269+ CHORES=""
270+
271+ # Process each commit
272+ while IFS= read -r line; do
273+ subject=$(echo "$line" | cut -d'|' -f1)
274+ body=$(echo "$line" | cut -d'|' -f2-)
275+
276+ # Extract issue number from body if present
277+ issue=$(echo "$body" | grep -oE "Fixes #[0-9]+" | head -1 || echo "")
278+ if [ -n "$issue" ]; then
279+ entry="- $subject - $issue"
280+ else
281+ entry="- $subject"
282+ fi
283+
284+ # Categorize by prefix
285+ if echo "$subject" | grep -qE "^fix(\(|:)"; then
286+ BUGS="${BUGS}${entry}"$'\n'
287+ elif echo "$subject" | grep -qE "^feat(\(|:)"; then
288+ FEATURES="${FEATURES}${entry}"$'\n'
289+ elif echo "$subject" | grep -qE "^chore(\(|:)"; then
290+ CHORES="${CHORES}${entry}"$'\n'
291+ else
292+ # Default to chores for uncategorized
293+ CHORES="${CHORES}${entry}"$'\n'
294+ fi
295+ done < <(git log ${PREVIOUS_TAG:+$PREVIOUS_TAG..}HEAD --pretty=format:"%s (%h)|%b---END---" --no-merges | sed 's/---END---/\n/g')
296+
297+ # Build changelog with categories
298+ CHANGELOG=""
299+
300+ if [ -n "$BUGS" ]; then
301+ CHANGELOG="${CHANGELOG}### 🐛 Bugs Squashed"$'\n\n'"${BUGS}"$'\n'
302+ fi
303+
304+ if [ -n "$FEATURES" ]; then
305+ CHANGELOG="${CHANGELOG}### 🎉 Features Added"$'\n\n'"${FEATURES}"$'\n'
306+ fi
307+
308+ if [ -n "$CHORES" ]; then
309+ CHANGELOG="${CHANGELOG}### 🧹 Chores Addressed"$'\n\n'"${CHORES}"$'\n'
264310 fi
265311
266312 # If changelog is empty, use a fun message
0 commit comments