Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tools/release/changelog.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {green, grey} from 'chalk';
import {bold, green, yellow} from 'chalk';
import {createReadStream, createWriteStream, readFileSync} from 'fs';
import {prompt} from 'inquirer';
import {join} from 'path';
Expand Down Expand Up @@ -63,7 +63,8 @@ export async function promptChangelogReleaseName(): Promise<string> {
* and has been cherry-picked into "master". In that case, the changelog will already contain
* commits from master which might be added to the changelog again. This is because usually
* patch and minor releases are tagged from the publish branches and therefore
* conventional-changelog tries to build the changelog from last major version to master's HEAD.
* conventional-changelog tries to build the changelog from last major version to master's
* HEAD when a new major version is being published from the "master" branch.
*/
function createDedupeWriterOptions(changelogPath: string) {
const existingChangelogContent = readFileSync(changelogPath, 'utf8');
Expand All @@ -76,8 +77,8 @@ function createDedupeWriterOptions(changelogPath: string) {
group.commits = group.commits.filter((commit: any) => {
// NOTE: We cannot compare the SHA's because the commits will have a different SHA
// if they are being cherry-picked into a different branch.
if (existingChangelogContent.includes(commit.header)) {
console.log(grey(`Excluding: "${commit.header}" (${commit.hash})`));
if (existingChangelogContent.includes(commit.subject)) {
console.log(yellow(` ↺ Skipping duplicate: "${bold(commit.header)}"`));
return false;
}
return true;
Expand Down