File tree Expand file tree Collapse file tree 3 files changed +20
-13
lines changed
Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change 1111jobs :
1212 check_release :
1313 runs-on : ubuntu-22.04
14+ outputs :
15+ should_run : ${{ steps.check.outputs.should_run }}
1416 steps :
1517 - name : Check if release merge or workflow dispatch
16- id : check_release
18+ id : check
1719 uses : actions/github-script@v8
1820 with :
1921 script : |
20- // Allow workflow_dispatch and release PR merges
21- if (context.eventName !== 'push') return;
22-
23- // For push events, check if it's a release merge
24- const isReleaseMerge = /Release \d{6}/.test(context.payload.head_commit.message);
25- if (!isReleaseMerge) core.setFailed('Not a release merge - skipping workflow');
22+ const shouldRun = context.eventName === 'workflow_dispatch' ||
23+ /Release \d{6}/.test(context.payload.head_commit.message);
24+ core.setOutput('should_run', shouldRun);
2625
2726 test_build_deploy :
2827 runs-on : ubuntu-22.04
2928 needs : check_release
29+ if : needs.check_release.outputs.should_run == 'true'
3030 steps :
3131 - uses : actions/checkout@v5
3232 - name : Use Node.js
Original file line number Diff line number Diff line change 77 create-release-notes :
88 runs-on : ubuntu-latest
99
10- env :
11- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
12-
1310 steps :
1411 - uses : actions/checkout@v5
1512 with :
@@ -59,17 +56,23 @@ jobs:
5956 return;
6057 }
6158
62- core.setOutput('notes', releasePr.body);
59+ const releaseNotes = releasePr.body.split('<!--')[0].trim();
60+ core.setOutput('notes', releaseNotes);
61+
6362 - name : Create GitHub Release
6463 uses : actions/github-script@v8
64+ env :
65+ RELEASE_NOTES : ${{ steps.release_notes.outputs.notes }}
6566 with :
6667 script : |
68+ const notes = process.env.RELEASE_NOTES;
69+
6770 await github.rest.repos.createRelease({
6871 owner: context.repo.owner,
6972 repo: context.repo.repo,
7073 tag_name: '${{ steps.get_version.outputs.version }}',
7174 name: 'Release ${{ steps.get_version.outputs.version }}',
72- body: '${{ steps.release_notes.outputs. notes }}' ,
75+ body: notes,
7376 draft: false,
7477 prerelease: false
7578 });
Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ jobs:
103103 uses : actions/github-script@v8
104104 with :
105105 script : |
106- const prs = JSON.parse('${{ steps.get_prs.outputs.prs }}');
106+ // Trim whitespace from PR titles
107+ const prs = JSON.parse('${{ steps.get_prs.outputs.prs }}').map(pr => ({
108+ ...pr,
109+ title: pr.title.trim()
110+ }));
107111
108112 // Categorize PRs
109113 const features = prs.filter(pr => /^feat/i.test(pr.title));
You can’t perform that action at this time.
0 commit comments