File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { execSync } from "child_process" ;
2
+
3
+ function run ( ) : void {
4
+ const commits = execSync ( 'git log --format="- %s"' ) . toString ( ) . split ( "\n" ) ;
5
+
6
+ const lastReleasePos = commits . findIndex ( ( commit ) => / - m e t a ( .* ) c h a n g e l o g / i. test ( commit ) ) ;
7
+
8
+ const newCommits = commits . splice ( 0 , lastReleasePos ) . filter ( ( commit ) => {
9
+ // Filter out merge commits
10
+ if ( / M e r g e p u l l r e q u e s t / . test ( commit ) ) {
11
+ return false ;
12
+ }
13
+ // Filter release branch merged
14
+ if ( / M e r g e b r a n c h / . test ( commit ) ) {
15
+ return false ;
16
+ }
17
+ // Filter release commit itself
18
+ if ( / r e l e a s e : / . test ( commit ) ) {
19
+ return false ;
20
+ }
21
+
22
+ return true ;
23
+ } ) ;
24
+
25
+ newCommits . sort ( ( a , b ) => a . localeCompare ( b ) ) ;
26
+
27
+ const issueUrl = "https://github.com/getsentry/sentry-javascript-bundler-plugins/pull/" ;
28
+ const newCommitsWithLink = newCommits . map ( ( commit ) =>
29
+ commit . replace ( / # ( \d + ) / , `[#$1](${ issueUrl } $1)` )
30
+ ) ;
31
+
32
+ // eslint-disable-next-line no-console
33
+ console . log ( newCommitsWithLink . join ( "\n" ) ) ;
34
+ }
35
+
36
+ run ( ) ;
You can’t perform that action at this time.
0 commit comments