build: create release branch from FETCH_HEAD (#63731)

When creating the release branch, it should be based on the latest upstream changes to avoid building a release on a stale commit.

PR Close #63731
This commit is contained in:
Alan Agius 2025-09-11 12:02:18 +00:00 committed by Jessica Janiuk
parent cdf5d6763f
commit eec0bdcbb6

View file

@ -293,7 +293,7 @@ async function prepareReleasePullRequest(newVersion: string): Promise<void> {
console.log(chalk.blue('Creating release commit...'));
const releaseBranch = `devtools-release-${newVersion}`;
await exec(`git branch -D ${releaseBranch}`).catch(() => {});
await exec(`git checkout -b ${releaseBranch}`);
await exec(`git checkout -b ${releaseBranch} FETCH_HEAD`);
await exec(`git commit -m "${releaseCommitPrefix}${newVersion}" "${manifestPaths.join('" "')}"`);
await exec(`git push origin ${releaseBranch} --force-with-lease`);
console.log(chalk.green('Release branch pushed to your fork.'));