Skip to content

Commit 8868726

Browse files
committed
more fixes for library release notes
1 parent 88433de commit 8868726

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ jobs:
176176
authors = os.environ.get('AUTHORS', '').strip()
177177
lib_notes = os.environ.get('LIB_NOTES', '').strip()
178178
179+
# Clean up library notes: remove Contributors section and Changes headers
180+
if lib_notes:
181+
# Remove ## Contributors section and everything after it per release
182+
lib_notes = re.sub(r'## Contributors[^\n]*\n.*?(?=###|\Z)', '', lib_notes, flags=re.DOTALL)
183+
# Remove ## Changes headers (keep the content)
184+
lib_notes = re.sub(r'^## Changes[^\n]*\n+', '', lib_notes, flags=re.MULTILINE)
185+
# Downgrade any remaining ## headers to ####
186+
lib_notes = re.sub(r'^## ', '#### ', lib_notes, flags=re.MULTILINE)
187+
lib_notes = lib_notes.strip()
188+
179189
# Remove release-drafter's empty placeholders
180190
body = body.replace('No changes\n', '').replace('No changes', '')
181191
body = body.replace('No contributors\n', '').replace('No contributors', '')

0 commit comments

Comments
 (0)