File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -41,14 +41,29 @@ jobs:
4141 const pull_number = prs[0].number;
4242 const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
4343
44- // Extract content between gitstream placeholders, excluding header and footer
44+ // Extract content from PR description - prioritize CHANGELOG if present
4545 let releaseNote = pr.title;
4646
4747 if (pr.body) {
48- const contentMatch = pr.body.match(/<!--start_gitstream_placeholder-->.*?### ✨ PR Description\s*(.*?)\s*_Generated by LinearB AI.*?<!--end_gitstream_placeholder-->/s);
49-
50- if (contentMatch) {
51- releaseNote = contentMatch[1].trim();
48+ // First, check for __CHANGELOG__ section
49+ const changelogMatch = pr.body.match(/__CHANGELOG__\s*(.*?)\s*_Generated by LinearB AI/s);
50+
51+ if (changelogMatch) {
52+ releaseNote = changelogMatch[1].trim();
53+ } else {
54+ // Fallback to original gitstream placeholder extraction
55+ const contentMatch = pr.body.match(/<!--start_gitstream_placeholder-->.*?### ✨ PR Description\s*(.*?)\s*_Generated by LinearB AI.*?<!--end_gitstream_placeholder-->/s);
56+
57+ if (contentMatch) {
58+ releaseNote = contentMatch[1].trim();
59+ } else {
60+ // New format without gitstream placeholders
61+ const newFormatMatch = pr.body.match(/## ✨ PR Description\s*(.*?)\s*(?:__CHANGELOG__|_Generated by LinearB AI)/s);
62+
63+ if (newFormatMatch) {
64+ releaseNote = newFormatMatch[1].trim();
65+ }
66+ }
5267 }
5368 }
5469
You can’t perform that action at this time.
0 commit comments