Skip to content

Deduplicate leading verbs in auto-generated changelog entries - #35

Merged
yCodeTech merged 2 commits into
masterfrom
copilot/fix-duplicated-verbs-changelog
Jul 20, 2026
Merged

Deduplicate leading verbs in auto-generated changelog entries#35
yCodeTech merged 2 commits into
masterfrom
copilot/fix-duplicated-verbs-changelog

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown

Auto changelog generation was duplicating action words when PR titles already started with a verb (for example, feat: added... rendering as Added added...). This change normalizes entry titles so the changelog prefix and title body do not repeat the same verb.

  • What changed

    • Added a prefix-aware verb normalization map in update-changelog.mjs to detect leading forms like add/added/adding, fix/fixed/fixing, revert/reverted, etc.
    • Introduced removeLeadingDuplicateVerb(prefix, title) and applied it during entry construction in buildEntry(...).
    • Kept existing section/prefix resolution behavior (TYPE_TO_SECTION, TYPE_TO_PREFIX) and only adjusted title text generation.
  • Behavioral impact

    • feat: added support for X- Added support for X ...
    • feat: add support for X- Added support for X ...
    • fix: fixed race condition- Fixed race condition ...
  • Example

    const prefix = TYPE_TO_PREFIX[type] ?? section;
    const dedupedTitle = removeLeadingDuplicateVerb(prefix, cleanedTitle);
    return `- ${prefix} ${dedupedTitle} ([#${prNumber}](${prUrl})) by @${prAuthor}`;

@yCodeTech
yCodeTech marked this pull request as ready for review July 20, 2026 06:49
Copilot AI review requested due to automatic review settings July 20, 2026 06:49
@yCodeTech
yCodeTech merged commit 5123df0 into master Jul 20, 2026
2 checks passed
@yCodeTech
yCodeTech deleted the copilot/fix-duplicated-verbs-changelog branch July 20, 2026 06:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the changelog entry generation logic to avoid duplicated leading action verbs when PR titles already start with a verb that matches the changelog prefix (e.g., preventing “Added added …”).

Changes:

  • Added a prefix-to-leading-verb regex map to detect and strip duplicated verb forms from the start of titles.
  • Introduced removeLeadingDuplicateVerb(prefix, title) and integrated it into buildEntry(...) so entries render without repeated verbs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +313 to +315
const dedupedTitle = removeLeadingDuplicateVerb(prefix, cleanedTitle);
const titlePart = dedupedTitle ? ` ${dedupedTitle}` : ` ${cleanedTitle.trim()}`;
return `- ${prefix}${titlePart} ([#${prNumber}](${prUrl})) by @${prAuthor}${formatPRDescription(prBody)}\n<!-- end -->`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants