Fix release formatting to support Major/Minor/Patch changes#6
Merged
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #5
This commit fixes two bugs in the GitHub release formatting: 1. **Remove section headers**: The script now removes "### Major Changes", "### Minor Changes", and "### Patch Changes" headers from release notes. Previously, it only handled Patch changes, causing Minor and Major releases to display these headers incorrectly. 2. **Enable PR detection for all release types**: By fixing the regex to match all changeset types (Major/Minor/Patch), PR detection now works for all releases, not just patch releases. Root Cause: - The original regex pattern only matched "### Patch Changes" - When a Minor or Major release was created, the regex failed to match - The script exited early, skipping formatting and PR link detection - This resulted in raw changeset headers appearing in release notes Solution: - Updated regex to match any changeset type: /### (Major|Minor|Patch) Changes/ - Extract commit hash from any changeset format - Continue with formatting and PR detection for all release types - Updated PACKAGE_NAME constant to match package.json Fixes #5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Added a comprehensive test script to verify the regex pattern correctly handles all changeset types (Major, Minor, Patch) with and without commit hashes. This helps ensure the fix works as expected and provides a reusable test for future validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Member
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5 - Resolves two bugs in GitHub release formatting:
Problem
The
scripts/format-release-notes.mjsscript only handled### Patch Changessections, causing it to fail on Minor and Major releases:Root Cause
The script at
scripts/format-release-notes.mjs(lines 92-115) only matched### Patch Changes:When a Minor or Major release was created:
Solution
Updated the regex to match all changeset types:
Changes Made
Modified Files:
scripts/format-release-notes.mjs- Fixed regex pattern to handle all changeset types and updated PACKAGE_NAME constantTesting:
experiments/test-regex-pattern.mjs- Comprehensive test script verifying the regex pattern handles all formats correctlyImplementation Details
The fix:
### (Major|Minor|Patch) Changesinstead of just### Patch Changes- abc1234: Description) and without (- Description)gh-download-pull-requestto match package.jsonTesting
experiments/test-regex-pattern.mjsnpm run lint)npm run format:check)npm run check:file-size)Expected Behavior After Fix
Release notes will now display cleanly for all release types:
✅ No section headers
✅ PR link included (when available)
✅ Clean formatting
Reference
This bug was discovered and fixed in the upstream template repository:
🤖 Generated with Claude Code