Skip to content

Commit 5201add

Browse files
committed
fix(ng-dev/release): fetch release notes compare tag and store it locally
The release notes compare tag might not exist locally if the local repository has not been synced with upstream. We fetch the release notes compare tag in order to be able to build the changelog. Our current fetch logic incorrectly stores the tag reference in `FETCH_HEAD`, while we want it to be stored locally. This commit fixes that.
1 parent b1d0dac commit 5201add

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ng-dev/release/publish/actions.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,14 @@ export abstract class ReleaseAction {
415415
const releaseNotesCompareTag = getReleaseTagForVersion(compareVersionForReleaseNotes);
416416

417417
// Fetch the compare tag so that commits for the release notes can be determined.
418-
this.git.run(['fetch', this.git.getRepoGitUrl(), `refs/tags/${releaseNotesCompareTag}`]);
418+
// We forcibly override existing local tags that are named similar as we will fetch
419+
// the correct tag for release notes comparison from the upstream remote.
420+
this.git.run([
421+
'fetch',
422+
'--force',
423+
this.git.getRepoGitUrl(),
424+
`refs/tags/${releaseNotesCompareTag}:refs/tags/${releaseNotesCompareTag}`,
425+
]);
419426

420427
// Build release notes for commits from `<releaseNotesCompareTag>..HEAD`.
421428
const releaseNotes = await ReleaseNotes.forRange(newVersion, releaseNotesCompareTag, 'HEAD');

0 commit comments

Comments
 (0)