@@ -45,7 +45,7 @@ for (const dirName of fs.readdirSync(generatedDir)) {
4545 . readdirSync ( packageDir )
4646 . filter ( ( f ) => f . endsWith ( ".d.ts" ) ) ;
4747
48- let releaseNotes = "" ;
48+ const releaseNotes = [ ] ;
4949
5050 // Look through each .d.ts file included in a package to
5151 // determine if anything has changed
@@ -67,10 +67,10 @@ for (const dirName of fs.readdirSync(generatedDir)) {
6767 if ( oldFile !== generatedDTSContent )
6868 printDiff ( oldFile , generatedDTSContent ) ;
6969
70- const title = `\n ## \`${ file } \`\n\n ` ;
70+ const title = `## \`${ file } \`` ;
7171 const notes = generateChangelogFrom ( oldFile , generatedDTSContent ) ;
72- releaseNotes = title ;
73- releaseNotes += notes . trim ( ) === "" ? "No changes" : notes ;
72+ releaseNotes . push ( title ) ;
73+ releaseNotes . push ( notes . trim ( ) === "" ? "No changes" : notes ) ;
7474
7575 upload = upload || oldFile !== generatedDTSContent ;
7676 } catch ( error ) {
@@ -98,7 +98,10 @@ Assuming that this means we need to upload this package.`);
9898 } else {
9999 console . log ( publish . stdout ?. toString ( ) ) ;
100100
101- await createRelease ( `${ pkgJSON . name } @${ pkgJSON . version } ` , releaseNotes ) ;
101+ await createRelease (
102+ `${ pkgJSON . name } @${ pkgJSON . version } ` ,
103+ releaseNotes . join ( "\n\n" )
104+ ) ;
102105 }
103106 } else {
104107 console . log (
@@ -109,8 +112,8 @@ Assuming that this means we need to upload this package.`);
109112
110113 uploaded . push ( dirName ) ;
111114
112- console . log ( "\n# Release notes:" ) ;
113- console . log ( releaseNotes , "\n\n" ) ;
115+ console . log ( "\n# Release notes:\n " ) ;
116+ console . log ( releaseNotes . join ( "\n\n" ) , "\n\n" ) ;
114117 }
115118}
116119console . log ( "" ) ;
@@ -152,10 +155,11 @@ async function createRelease(tag, body) {
152155
153156function verify ( ) {
154157 const authToken = process . env . GITHUB_TOKEN || process . env . GITHUB_API_TOKEN ;
155- if ( ! authToken )
158+ if ( ! authToken ) {
156159 throw new Error (
157160 "There isn't an ENV var set up for creating a GitHub release, expected GITHUB_TOKEN."
158161 ) ;
162+ }
159163}
160164
161165/** @param {string } filepath */
0 commit comments