@@ -58,10 +58,26 @@ jobs:
5858 const categorizedPRs = changelogConfig.map(obj => ({
5959 ...obj,
6060 notes: [],
61- subCategories: obj.subCategories ?? (obj.labels.includes("update script") ? [
62- { title: "🐞 Bug Fixes", labels: ["bugfix"] },
63- { title: "✨ Feature Updates", labels: ["feature"] }
64- ] : [])
61+ subCategories: obj.subCategories ?? (
62+ obj.labels.includes("update script") ? [
63+ { title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
64+ { title: "✨ New Features", labels: ["feature"], notes: [] },
65+ { title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] }
66+ ] :
67+ obj.labels.includes("maintenance") ? [
68+ { title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
69+ { title: "✨ New Features", labels: ["feature"], notes: [] },
70+ { title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
71+ { title: "📡 API", labels: ["api"], notes: [] },
72+ { title: "Github", labels: ["github"], notes: [] }
73+ ] :
74+ obj.labels.includes("website") ? [
75+ { title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
76+ { title: "✨ New Features", labels: ["feature"], notes: [] },
77+ { title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
78+ { title: "Script Information", labels: ["json"], notes: [] }
79+ ] : []
80+ )
6581 }));
6682
6783 const latestDateInChangelog = new Date(process.env.LATEST_DATE);
@@ -110,6 +126,7 @@ jobs:
110126
111127 return categorizedPRs;
112128
129+
113130 - name : Update CHANGELOG.md
114131 uses : actions/github-script@v7
115132 with :
@@ -124,7 +141,8 @@ jobs:
124141
125142 console.log(JSON.stringify(categorizedPRs, null, 2));
126143
127- let newReleaseNotes = `## ${today}\n\n### Changes\n\n`;
144+
145+ let newReleaseNotes = `## ${today}\n\n`;
128146 for (const { title, notes, subCategories } of categorizedPRs) {
129147 const hasSubcategories = subCategories && subCategories.length > 0;
130148 const hasMainNotes = notes.length > 0;
@@ -133,17 +151,16 @@ jobs:
133151
134152 if (hasMainNotes || hasSubNotes) {
135153 newReleaseNotes += `### ${title}\n\n`;
136- }
154+ }
137155
138156 if (hasMainNotes) {
139- newReleaseNotes += `${notes.join("\n")}\n\n`;
140- }
141-
157+ newReleaseNotes += ` ${notes.join("\n")}\n\n`;
158+ }
142159 if (hasSubcategories) {
143160 for (const { title : subTitle, notes: subNotes } of subCategories) {
144161 if (subNotes && subNotes.length > 0) {
145- newReleaseNotes += ` # ### ${subTitle}\n\n`;
146- newReleaseNotes += ` ${subNotes.join("\n ")}\n\n`;
162+ newReleaseNotes += ` - # ### ${subTitle}\n\n`;
163+ newReleaseNotes += ` ${subNotes.join("\n ")}\n\n`;
147164 }
148165 }
149166 }
@@ -206,4 +223,4 @@ jobs:
206223 PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
207224 if [ -n "$PR_NUMBER" ]; then
208225 gh pr review $PR_NUMBER --approve
209- fi
226+ fi
0 commit comments