mirror of
https://github.com/n8n-io/n8n
synced 2026-04-21 15:47:20 +00:00
ci: Modify immutable commit subject via spreading (#27467)
This commit is contained in:
parent
61a526133d
commit
bf856cd442
1 changed files with 10 additions and 2 deletions
12
.github/scripts/update-changelog.mjs
vendored
12
.github/scripts/update-changelog.mjs
vendored
|
|
@ -1,5 +1,5 @@
|
|||
import createTempFile from 'tempfile';
|
||||
import { ConventionalChangelog, packagePrefix } from 'conventional-changelog';
|
||||
import { ConventionalChangelog } from 'conventional-changelog';
|
||||
import { resolve } from 'path';
|
||||
import { createReadStream, createWriteStream } from 'fs';
|
||||
import { dirname } from 'path';
|
||||
|
|
@ -35,7 +35,15 @@ const changelogStream = new ConventionalChangelog()
|
|||
// Strip backport information from commit subject, e.g.:
|
||||
// "Fix something (backport to release-candidate/2.12.x) (#123)" → "Fix something (#123)"
|
||||
if (commit.subject) {
|
||||
commit.subject = commit.subject.replace(/\s*\(backport to [^)]+\)/g, '');
|
||||
// The commit.subject is immutable so we need to recreate the commit object
|
||||
|
||||
/** @type { import("conventional-changelog").Commit } */
|
||||
let newCommit = /** @type { any } */ ({
|
||||
...commit,
|
||||
subject: commit.subject.replace(/\s*\(backport to [^)]+\)/g, ''),
|
||||
});
|
||||
|
||||
return newCommit;
|
||||
}
|
||||
|
||||
return commit;
|
||||
|
|
|
|||
Loading…
Reference in a new issue