Skip to content

How do I add a releaseRule that also respects the ! for a breaking change? (conventionalcommits preset) #413

Open
@natesilva

Description

@natesilva

We’re using the conventionalcommits preset. In this preset, adding an exclamation after the type triggers a breaking change/major version bump.

Using the default releaseRules this works. feat!:, fix!: and perf!: are recognized as major/breaking changes.

In fact, anything with an exclamation triggers a major/breaking change, such as docs!: or even allGloryToTheHypnoToad!:

Now we want to add refactor as a type.

plugins: [
    [
      '@semantic-release/commit-analyzer',
      {
        preset: 'conventionalcommits'
        releaseRules: [{ type: 'refactor', release: 'patch' }]
      }
    ],

After adding this, refactor: triggers a patch change, as expected.

But refactor!: no longer triggers a major version bump.

How do we get this to work?

Edit to add version info: semantic-release 19.0.5, @semantic-release/commit-analyzer 9.0.2, Node 16.19.0

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