@@ -2,52 +2,50 @@ import fs from "node:fs/promises";
2
2
import path from "node:path" ;
3
3
import { execSync } from "node:child_process" ;
4
4
5
- const THANKLESS_COMMITTERS = [ "thdxr" , "fwang" , "jayair" ] ;
5
+ const THANKLESS_COMMITTERS = [ "thdxr" , "fwang" , "jayair" , "conico974" ] ;
6
6
7
7
const { version } = JSON . parse (
8
8
await fs . readFile ( "./packages/open-next/package.json" ) ,
9
9
) ;
10
10
11
- const changesets = JSON . parse ( await fs . readFile ( ".changeset/config.json" ) ) ;
12
- const packages = changesets . fixed [ 0 ] ;
13
-
14
11
const 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 ;
29
26
}
27
+ }
30
28
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 ;
45
33
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 ;
47
42
}
43
+
44
+ if ( line . startsWith ( "## " ) ) break ;
48
45
}
49
46
}
50
47
48
+
51
49
const notes = [ "#### Changes" , ...changes ] ;
52
50
console . log ( notes . join ( "\n" ) ) ;
53
51
console . log ( `::set-output name=notes::${ notes . join ( "%0A" ) } ` ) ;
0 commit comments