Skip to content

Commit c88e4b4

Browse files
committed
Ensure release notes aren't wrapped with ```markdown section
1 parent 867fa53 commit c88e4b4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/publish-release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ jobs:
104104
105105
# Save the generated release notes to a file
106106
release_notes = response.choices[0].message.content
107+
108+
# Remove markdown code block markers if present
109+
if release_notes.startswith("```markdown"):
110+
release_notes = release_notes.replace("```markdown", "", 1)
111+
if release_notes.endswith("```"):
112+
release_notes = release_notes[:-3]
113+
elif release_notes.startswith("```"):
114+
release_notes = release_notes.replace("```", "", 1)
115+
if release_notes.endswith("```"):
116+
release_notes = release_notes[:-3]
117+
118+
# Strip any leading/trailing whitespace
119+
release_notes = release_notes.strip()
120+
107121
with open("release_notes.md", "w") as f:
108122
f.write(release_notes)
109123

0 commit comments

Comments
 (0)