mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Make processChangelogForBackports dry-run-aware
This commit is contained in:
@@ -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}'.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,6 +674,7 @@ export async function prepareNewBranch(
|
||||
`Migrating changelog notes from v${sourceBranchMajorVersion} to v${targetBranchMajorVersion}`,
|
||||
);
|
||||
changelog.processChangelogForBackports(
|
||||
options,
|
||||
sourceBranchMajorVersion,
|
||||
targetBranchMajorVersion,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user