@@ -2,52 +2,50 @@ import fs from "node:fs/promises";
22import path from "node:path" ;
33import { execSync } from "node:child_process" ;
44
5- const THANKLESS_COMMITTERS = [ "thdxr" , "fwang" , "jayair" ] ;
5+ const THANKLESS_COMMITTERS = [ "thdxr" , "fwang" , "jayair" , "conico974" ] ;
66
77const { version } = JSON . parse (
88 await fs . readFile ( "./packages/open-next/package.json" ) ,
99) ;
1010
11- const changesets = JSON . parse ( await fs . readFile ( ".changeset/config.json" ) ) ;
12- const packages = changesets . fixed [ 0 ] ;
13-
1411const changes = new Set ( ) ;
15- for ( const pkg of packages ) {
16- const changelog = path . join (
17- "packages" ,
18- pkg . split ( "/" ) . at ( - 1 ) ,
19- "CHANGELOG.md ",
20- ) ;
21- const lines = ( await fs . readFile ( changelog ) ) . toString ( ) . split ( "\n" ) ;
22- let start = false ;
23- for ( let line of lines ) {
24- if ( ! start ) {
25- if ( line === `## ${ version } ` ) {
26- start = true ;
27- continue ;
28- }
12+
13+ // We only need to look for changes in packages/open-next
14+ const changelog = path . join (
15+ "packages" ,
16+ "open-next ",
17+ "CHANGELOG.md" ,
18+ ) ;
19+ const lines = ( await fs . readFile ( changelog ) ) . toString ( ) . split ( "\n" ) ;
20+ let start = false ;
21+ for ( let line of lines ) {
22+ if ( ! start ) {
23+ if ( line === `## ${ version } ` ) {
24+ start = true ;
25+ continue ;
2926 }
27+ }
3028
31- if ( start ) {
32- if ( line . startsWith ( "-" ) || line . startsWith ( "*" ) ) {
33- if ( line . includes ( "Updated dependencies" ) ) continue ;
34- if ( line . includes ( "@serverless-stack/" ) ) continue ;
35-
36- for ( const user of THANKLESS_COMMITTERS ) {
37- line = line . replace (
38- `Thanks [@${ user } ](https://github.com/${ user } )! ` ,
39- "" ,
40- ) ;
41- }
42- changes . add ( line ) ;
43- continue ;
44- }
29+ if ( start ) {
30+ if ( line . startsWith ( "-" ) || line . startsWith ( "*" ) ) {
31+ if ( line . includes ( "Updated dependencies" ) ) continue ;
32+ if ( line . includes ( "@serverless-stack/" ) ) continue ;
4533
46- if ( line . startsWith ( "## " ) ) break ;
34+ for ( const user of THANKLESS_COMMITTERS ) {
35+ line = line . replace (
36+ `Thanks [@${ user } ](https://github.com/${ user } )! ` ,
37+ "" ,
38+ ) ;
39+ }
40+ changes . add ( line ) ;
41+ continue ;
4742 }
43+
44+ if ( line . startsWith ( "## " ) ) break ;
4845 }
4946}
5047
48+
5149const notes = [ "#### Changes" , ...changes ] ;
5250console . log ( notes . join ( "\n" ) ) ;
5351console . log ( `::set-output name=notes::${ notes . join ( "%0A" ) } ` ) ;
0 commit comments