Skip to content

Commit 5919fe1

Browse files
committed
Make processChangelogForBackports dry-run-aware
1 parent dc2794b commit 5919fe1

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎pr-checks/changelog.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function setVersionAndDate(
5555
* entries that only apply to newer versions.
5656
*/
5757
export function processChangelogForBackports(
58+
options: DryRunOption,
5859
sourceBranchMajorVersion: string,
5960
targetBranchMajorVersion: string,
6061
): void {
@@ -120,5 +121,11 @@ export function processChangelogForBackports(
120121
}
121122
}
122123

123-
fs.writeFileSync(CHANGELOG_FILE, output, "utf8");
124+
if (!options.dryRun) {
125+
fs.writeFileSync(CHANGELOG_FILE, output, "utf8");
126+
} else {
127+
console.info(
128+
`[DRY RUN] Would have written updated changelog to replace 'v${sourceBranchMajorVersion}' with 'v${targetBranchMajorVersion}'.`,
129+
);
130+
}
124131
}

‎pr-checks/update-release-branch.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ export async function prepareNewBranch(
674674
`Migrating changelog notes from v${sourceBranchMajorVersion} to v${targetBranchMajorVersion}`,
675675
);
676676
changelog.processChangelogForBackports(
677+
options,
677678
sourceBranchMajorVersion,
678679
targetBranchMajorVersion,
679680
);

0 commit comments

Comments
 (0)