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
17 changes: 6 additions & 11 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
export default {
branches: [{ name: "v1", channel: "v1" }, "main"],
plugins: [
[
"@semantic-release/commit-analyzer",
{
preset: "conventionalcommits", // 👈 Add this
["@semantic-release/commit-analyzer", {
parserOpts: {
headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
Comment on lines +6 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Greedy scope regex 🐞 Bug ≡ Correctness

The new headerPattern/breakingHeaderPattern use (.*) for the scope capture, which can consume
) characters from the subject and cause the header regex not to match at all. When that happens,
semantic-release parsing can misclassify or skip commits, producing incorrect version bumps and
changelog entries.
Agent Prompt
## Issue description
`parserOpts.headerPattern` and `parserOpts.breakingHeaderPattern` use a greedy `.*` inside the optional scope group (`\((.*)\)`), which can over-match when the subject contains `)` and prevent the header from matching.

## Issue Context
This config is used by semantic-release’s commit parsing; if the header regex fails, the commit may be uncategorized/ignored for bumping and/or changelog generation.

## Fix Focus Areas
- release.config.js[6-8]

## Suggested change
Replace `(.*)` with a scope-safe pattern such as `([^)]*)` (or `(.+?)`) in both regexes, e.g.:
- `headerPattern: /^(\w*)(?:\(([^)]*)\))?!?: (.*)$/`
- `breakingHeaderPattern: /^(\w*)(?:\(([^)]*)\))?!: (.*)$/`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

headerCorrespondence: ["type", "scope", "subject"],
},
],
[
"@semantic-release/release-notes-generator",
{
preset: "conventionalcommits", // 👈 Add this for consistent notes
},
],
}],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
Comment on lines +4 to 13
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Notes parser mismatch 🐞 Bug ≡ Correctness

Only @semantic-release/commit-analyzer is configured with the custom parserOpts, while
@semantic-release/release-notes-generator remains unconfigured and will use its default parsing
rules. This can produce major version bumps for feat!: commits without corresponding
breaking-change content (or correct classification) in the generated release notes and
CHANGELOG.md.
Agent Prompt
## Issue description
`@semantic-release/commit-analyzer` has custom `parserOpts` for `!` breaking headers, but `@semantic-release/release-notes-generator` is configured as a bare string. This makes version calculation and notes/changelog generation parse commits differently.

## Issue Context
The changelog plugin consumes the release notes output; if the notes generator doesn’t recognize `feat!:` / `feat(scope)!:` consistently, releases can show a major bump while the notes/CHANGELOG don’t reflect the breaking change correctly.

## Fix Focus Areas
- release.config.js[4-17]

## Suggested change
Configure `@semantic-release/release-notes-generator` with the same `parserOpts` (and, if you intentionally rely on a specific preset, explicitly set it on both plugins as well), e.g.:

```js
["@semantic-release/release-notes-generator", {
  parserOpts: {
    headerPattern: /^(\w*)(?:\(([^)]*)\))?!?: (.*)$/,
    breakingHeaderPattern: /^(\w*)(?:\(([^)]*)\))?!: (.*)$/,
    headerCorrespondence: ["type", "scope", "subject"],
  },
}],
```

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Expand Down
Loading