Make processChangelogForBackports dry-run-aware

This commit is contained in:
Michael B. Gale
2026-07-14 13:52:56 +01:00
parent 4b861b89fc
commit e2472fc5f9
2 changed files with 9 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ export function setVersionAndDate(
* entries that only apply to newer versions.
*/
export function processChangelogForBackports(
options: DryRunOption,
sourceBranchMajorVersion: string,
targetBranchMajorVersion: string,
): void {
@@ -120,5 +121,11 @@ export function processChangelogForBackports(
}
}
fs.writeFileSync(CHANGELOG_FILE, output, "utf8");
if (!options.dryRun) {
fs.writeFileSync(CHANGELOG_FILE, output, "utf8");
} else {
console.info(
`[DRY RUN] Would have written updated changelog to replace 'v${sourceBranchMajorVersion}' with 'v${targetBranchMajorVersion}'.`,
);
}
}

View File

@@ -674,6 +674,7 @@ export async function prepareNewBranch(
`Migrating changelog notes from v${sourceBranchMajorVersion} to v${targetBranchMajorVersion}`,
);
changelog.processChangelogForBackports(
options,
sourceBranchMajorVersion,
targetBranchMajorVersion,
);