forked from conventional-changelog/standard-version
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Custom headerPattern
and headerCorrespondence
configuration are not properly parsing commits that have a prefix format like [TICKET-123] type: subject
.
Expected Behavior
Commits should be parsed and included in the changelog when using a custom header pattern.
Actual Behavior
- Commits are manually tested and match the regex pattern ✅
- But
context.commits
is empty during generation ❌ - Changelog is generated but contains no commit entries ❌
Configuration
// changelog.config.js
module.exports = {
parserOpts: {
headerPattern: /^\[[\w-]+\]\s+(\w*)(?:\(([\w\$\.\-\* ]*)\))?\!?\: (.*)$/,
headerCorrespondence: ['type', 'scope', 'subject'],
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES']
},
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' }
]
};
Sample commits
[xxx-1208] feat!: add new feature
[xxx-1208] fix: resolve bug
[xxx-1208] feat(api): update endpoint
Environment
commit-and-tag-version version : 12.6.0
Node.js version : 22.13.1
OS : macOS
Used command
commit-and-tag-version --config ./changelog.config.js --prerelease beta --dry-run
Questions
- Is there a specific way custom
headerPattern
should be structured? - Are there additional configuration options needed for custom commit formats?
- Could this be related to how
headerCorrespondence
maps the regex groups?
Workaround Attempted
- Tried different regex variations
- Verified commits exist in Git history
- Tested with
--first-release
flag - Simplified configuration to minimal setup
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working