Skip to content

Commit cac55c9

Browse files
Linbee 18079 gitstream action release notes [skip ci] (#351)
* Extract purpose from PR description for release notes in GitHub Actions workflow * Comment out the step to create and push a new tag in the GitHub Actions workflow * Update .github/workflows/create-tag-on-merge.yml Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com> * Fix release notes extraction and update output variable names in GitHub Actions workflow * Comment out deployment steps in GitHub Actions workflow for debugging * Refine release notes extraction to include content between gitstream placeholders and update output format * Uncomment tag creation and release steps in GitHub Actions workflow * Uncomment condition for auto-deployment in GitHub Actions workflow * Add step to update v2-lite branch after creating a new tag * Enhance release notes extraction to prioritize CHANGELOG section and support new format --------- Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>
1 parent 4f8405f commit cac55c9

1 file changed

Lines changed: 56 additions & 1 deletion

File tree

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

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,37 @@ jobs:
4040
if (prs?.length > 0) {
4141
const pull_number = prs[0].number;
4242
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
43+
44+
// Extract content from PR description - prioritize CHANGELOG if present
45+
let releaseNote = pr.title;
46+
47+
if (pr.body) {
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+
}
67+
}
68+
}
69+
70+
core.setOutput('pr-title', pr.title);
71+
core.setOutput('release-notes', releaseNote);
72+
core.setOutput('pr-number', pr.number);
73+
4374
return pr.labels.some(label => label.name.includes('auto-deploy'));
4475
}
4576
return false;
@@ -49,6 +80,30 @@ jobs:
4980
env:
5081
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5182
run: |
52-
gh release create $NEW_TAG --generate-notes
83+
PR_TITLE="${{ steps.should-deploy.outputs.pr-title }}"
84+
RELEASE_NOTES="${{ steps.should-deploy.outputs.release-notes }}"
85+
PR_NUMBER="${{ steps.should-deploy.outputs.pr-number }}"
86+
87+
# Create release notes with PR title, description, and link
88+
cat > release_notes.md << EOF
89+
## What's Changed
90+
91+
${PR_TITLE} in [#${PR_NUMBER}](https://github.com/${{ github.repository }}/pull/${PR_NUMBER})
92+
93+
${RELEASE_NOTES}
94+
EOF
95+
96+
gh release create $NEW_TAG --notes-file release_notes.md
5397
git checkout $NEW_TAG
5498
npm run update-v2-tag
99+
100+
- name: Update v2-lite
101+
if: steps.should-deploy.outputs.result == 'true'
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
run: |
105+
git checkout v2-lite
106+
git checkout $NEW_TAG package.json package-lock.json dist/
107+
git add package.json package-lock.json dist/
108+
git commit -m "Update v2-lite to $NEW_TAG"
109+
git push origin v2-lite

0 commit comments

Comments
 (0)