From 9c32bafd7dd07323ba977f21329ffb9c1fc5634e Mon Sep 17 00:00:00 2001 From: Gabriele De Rosa Date: Thu, 7 May 2026 14:35:51 +0200 Subject: [PATCH] fix(changelog): filter no-op dependency update bullets --- README.md | 4 ++-- action.yml | 2 +- scripts/normalize_changelog.py | 30 ++++++++++++++++++++++++- tests/test_normalize_changelog.py | 37 +++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2bd883c..4cadf75 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ GitHub Action to generate a `CHANGELOG.md` on new tags, with optional Telegram n ## Breaking changes in 2.x -- The action now lives at the repository root and is used as `Waveful/ChangelogAction@v2.0.3`. +- The action now lives at the repository root and is used as `Waveful/ChangelogAction@v2.0.4`. - The old split actions (`/generate`, `/notify`, `/annotate`) have been removed from the default setup. - Changelog generation is always the default behavior. - Telegram notification only runs when `telegram-bot-token`, `telegram-chat-id`, and `changelog-url` are all provided. @@ -67,7 +67,7 @@ jobs: steps: - name: Run changelog action id: changelog - uses: Waveful/ChangelogAction@v2.0.3 + uses: Waveful/ChangelogAction@v2.0.4 with: github-token: ${{ secrets.GITHUB_TOKEN }} target-branch: master diff --git a/action.yml b/action.yml index 7c2a154..9d42532 100644 --- a/action.yml +++ b/action.yml @@ -264,7 +264,7 @@ runs: Before writing, read all provided information and identify the distinct changes. PR details and commit details may overlap; combine them, do not duplicate. Merge multiple items addressing the same feature, bug, or area into a single bullet. - Put all PRs and commits whose only changes are dependency updates into one single bullet, formatted as "Update some dependencies (X, Y, Z)" with the updated dependency names in place of X, Y, Z. + Put all PRs and commits whose only changes are dependency updates into one single bullet, formatted as "Update some dependencies (X, Y, Z)" with the updated dependency names in place of X, Y, Z. Only add this bullet when at least one dependency was actually updated; never write "(none)", "(unknown)", or empty parentheses. Never describe the same change more than once. Focus on what changed from the user's perspective rather than listing every commit or PR. diff --git a/scripts/normalize_changelog.py b/scripts/normalize_changelog.py index d10fe72..b027e9c 100644 --- a/scripts/normalize_changelog.py +++ b/scripts/normalize_changelog.py @@ -10,6 +10,16 @@ from pathlib import Path +NOOP_DEPENDENCY_BULLET_RE = re.compile( + r"^[ \t]*(?:[•*-]|\d+[.)])[ \t]+" + r"(?:update(?:d|s)?|bump(?:ed|s)?|upgrade(?:d|s)?)\s+" + r"(?:some\s+)?dependenc(?:y|ies)\s*" + r"\(\s*(?:none|n/?a|not applicable|no dependencies?)\s*\)" + r"[.!?]?[ \t]*$", + flags=re.IGNORECASE | re.MULTILINE, +) + + def normalize(text): # Ensure blank line before ## headings (when not already preceded by one) text = re.sub(r"(?