Skip to content

Commit 27c4a06

Browse files
feat(ci): include non-conventional commits in changelog (#557)
Add "Other Changes" section to capture commits that don't follow the conventional commit format. This ensures all changes are documented in releases, even if they weren't properly formatted. - Non-conventional commits now appear in "📦 Other Changes" section - Updates both GitHub release notes and CHANGE.md - Conventional commits with types other than feat/fix remain excluded Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5e0eda9 commit 27c4a06

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,12 @@ jobs:
174174
FEATURES=""
175175
FIXES=""
176176
BREAKING=""
177+
OTHER=""
177178
CONTRIBUTORS=""
178179
179180
while IFS='|' read -r hash subject author; do
181+
[ -z "$hash" ] && continue
182+
180183
# Extract commit type and scope
181184
if [[ $subject =~ ^([a-z]+)(\(([^)]+)\))?!?:\ (.+)$ ]]; then
182185
type="${BASH_REMATCH[1]}"
@@ -198,6 +201,7 @@ jobs:
198201
fix)
199202
FIXES="${FIXES}- $entry\n"
200203
;;
204+
# Other conventional types (chore, docs, refactor, etc.) are intentionally excluded
201205
esac
202206
203207
# Check for breaking changes
@@ -208,6 +212,13 @@ jobs:
208212
fi
209213
BREAKING="${BREAKING}- $breaking_desc\n"
210214
fi
215+
else
216+
# Non-conventional commit - add to Other Changes
217+
# Clean up the subject (remove quotes if present)
218+
clean_subject=$(echo "$subject" | sed 's/^"//;s/"$//')
219+
if [ -n "$clean_subject" ]; then
220+
OTHER="${OTHER}- $clean_subject\n"
221+
fi
211222
fi
212223
213224
# Collect unique contributors
@@ -243,6 +254,11 @@ jobs:
243254
CHANGELOG="${CHANGELOG}### 🐛 Bug Fixes\n\n${FIXES}\n"
244255
fi
245256
257+
# Add other changes (non-feat/fix conventional commits and non-conventional commits)
258+
if [ -n "$OTHER" ]; then
259+
CHANGELOG="${CHANGELOG}### 📦 Other Changes\n\n${OTHER}\n"
260+
fi
261+
246262
# Add manual changelog if provided
247263
if [ -n "${{ inputs.manual_changelog }}" ]; then
248264
CHANGELOG="${CHANGELOG}### 📝 Additional Changes\n\n${{ inputs.manual_changelog }}\n\n"
@@ -254,7 +270,7 @@ jobs:
254270
fi
255271
256272
# If no changelog content, add placeholder
257-
if [ -z "$FEATURES" ] && [ -z "$FIXES" ] && [ -z "$BREAKING" ] && [ -z "${{ inputs.manual_changelog }}" ]; then
273+
if [ -z "$FEATURES" ] && [ -z "$FIXES" ] && [ -z "$BREAKING" ] && [ -z "$OTHER" ] && [ -z "${{ inputs.manual_changelog }}" ]; then
258274
CHANGELOG="${CHANGELOG}Minor updates and improvements.\n"
259275
fi
260276
@@ -345,6 +361,16 @@ jobs:
345361
fi
346362
fi
347363
364+
# Extract other changes (non-conventional commits)
365+
if echo "$CHANGELOG" | grep -q "### 📦 Other Changes"; then
366+
OTHERS=$(echo "$CHANGELOG" | sed -n '/### 📦 Other Changes/,/###/p' | grep "^- " | sed 's/^- /- /' || true)
367+
if [ -n "$OTHERS" ]; then
368+
while IFS= read -r line; do
369+
CHANGE_ENTRY="${CHANGE_ENTRY}${line}\n"
370+
done <<< "$OTHERS"
371+
fi
372+
fi
373+
348374
# Add manual changelog entries
349375
if [ -n "${{ inputs.manual_changelog }}" ]; then
350376
CHANGE_ENTRY="${CHANGE_ENTRY}${{ inputs.manual_changelog }}\n"

0 commit comments

Comments
 (0)