From e5dd89022bc20603aee9bcba57cc251a77a658bd Mon Sep 17 00:00:00 2001 From: Matsu Date: Wed, 18 Mar 2026 15:41:20 +0200 Subject: [PATCH] ci: Strip backport information from commit labels on changelog (#27203) --- .github/scripts/update-changelog.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/scripts/update-changelog.mjs b/.github/scripts/update-changelog.mjs index 54216f90d97..f5b875def56 100644 --- a/.github/scripts/update-changelog.mjs +++ b/.github/scripts/update-changelog.mjs @@ -30,7 +30,15 @@ const changelogStream = new ConventionalChangelog() const isBenchmarkScope = commit.scope === 'benchmark'; // Ignore commits that have 'benchmark' scope or '(no-changelog)' in the header - return hasNoChangelogInHeader || isBenchmarkScope ? null : commit; + if (hasNoChangelogInHeader || isBenchmarkScope) return null; + + // 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, ''); + } + + return commit; }, }) .writeStream()