Skip to content

releaseRules overriding if is a major version #805

@tiagoporto

Description

@tiagoporto

The following scenario is not working properly

Version
[email protected]

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions