File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import createTempFile from 'tempfile' ;
2- import { ConventionalChangelog , packagePrefix } from 'conventional-changelog' ;
2+ import { ConventionalChangelog } from 'conventional-changelog' ;
33import { resolve } from 'path' ;
44import { createReadStream , createWriteStream } from 'fs' ;
55import { dirname } from 'path' ;
@@ -35,7 +35,15 @@ const changelogStream = new ConventionalChangelog()
3535 // Strip backport information from commit subject, e.g.:
3636 // "Fix something (backport to release-candidate/2.12.x) (#123)" → "Fix something (#123)"
3737 if ( commit . subject ) {
38- commit . subject = commit . subject . replace ( / \s * \( b a c k p o r t t o [ ^ ) ] + \) / g, '' ) ;
38+ // The commit.subject is immutable so we need to recreate the commit object
39+
40+ /** @type { import("conventional-changelog").Commit } */
41+ let newCommit = /** @type { any } */ ( {
42+ ...commit ,
43+ subject : commit . subject . replace ( / \s * \( b a c k p o r t t o [ ^ ) ] + \) / g, '' ) ,
44+ } ) ;
45+
46+ return newCommit ;
3947 }
4048
4149 return commit ;
You can’t perform that action at this time.
0 commit comments