semantic-release / semantic-release/commit-analyzer

releaseRules overriding if is a major version

Open
#805 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
448
Forks
82
Avg merge
17h 41m
Merged PRs (30d)
4

Description

The following scenario is not working properly

Version
semantic-release@24.2.7

Config

//.releaserc.mjs

const config = {
  branches: ['main'],
  preset: 'conventionalcommits',
  plugins: [
    [
      '@semantic-release/commit-analyzer',
      {
        releaseRules: [
          {
            type: 'docs',
            release: 'minor',
          },
          {
            type: 'refactor',
            release: 'minor',
          },
        ],
      },
    ],
    '@semantic-release/release-notes-generator',
    '@semantic-release/github',
  ],
}

export default config

Example

Current version: 1.0.0

Commit list

  • refactor!: rewrite algorithm
  • refactor: refactor init function
  • docs: update usage section
Expecting result

Next Release: 2.0.0

Release notes, something like:

### ⚠ BREAKING CHANGES

    * rewrite algorithm

### Code Refactoring

    * rewrite algorithm (a2a7ff1)
    * refactor init function (a2a4rf1)

### Documentation
    * update usage section (a23erf1)
Current result

Next Release: 1.1.0

Release notes, something like:

### ⚠ BREAKING CHANGES

    * rewrite algorithm

### Code Refactoring

    * rewrite algorithm (a2a7ff1)

Sum-up

The major version is being overridden by releaseRules

{
  type: "refactor",
  release: "minor"
}

Commits of type docs and refactor are being ignored in the release notes unless they are a breaking change.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported configuration with the listed breaking, refactor, and docs commits, then trace how releaseRules are applied during commit analysis and release-note generation. Done means the breaking change still produces 2.0.0 while the refactor and docs commits remain represented in the release notes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
release, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.