Skip to content

Commit 1c07af0

Browse files
committed
Enhance release notes extraction to prioritize CHANGELOG section and support new format
1 parent 97bec01 commit 1c07af0

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/create-tag-on-merge.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)