Semantic-Release doesn't create release with BREAKING CHANGE
Asked Answered
J

2

8

When I create a commit like this, git commit -m'BREAKING CHANGE: foo bar' and push up semantic-release tells me,

[@semantic-release/commit-analyzer] › ℹ  Analyzing commit: BREAKING CHANGE: Changes from slice_into_subrepo
[@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[@semantic-release/commit-analyzer] › ℹ  Analysis of 1 commits complete: no release

How come BREAKING CHANGE doesn't create a release, it's documented to do that here,

BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reasons.

Juna answered 22/11, 2021 at 6:58 Comment(0)
J
14

This is a really poor error. The reason why is reported in GitHub issue #108,

Please see the Angular Commit Message Conventions. BREAKING CHANGE: must be in the footer of the commit. You wrote it in the subject.

This may be confusing because the example on the home page shows,

perf(pencil): remove graphiteWidth option

BREAKING CHANGE: The graphiteWidth option has been removed.
The default graphite width of 10mm is always used for performance reasons.  

This is not two examples, it's one. This is how it looks to have "BREAKING CHANGE:" in the footer.

This is also touched on on the documentation for @semantic-release/commit-analyzer,

Note: Your commits must be formatted exactly as specified by the chosen convention. For example the Angular Commit Message Conventions require the BREAKING CHANGE keyword to be followed by a colon (:) and to be in the footer of the commit message.

For more information see the upsream docs on "Angular Commit Message Format"

Juna answered 22/11, 2021 at 6:58 Comment(2)
OMG I just ran into this problem. What the heck is a "footer" in commit message? I have no idea a commit message can have subject and footer differences. :(Eamon
Also worth mentioning that only the following commit types will make a release: - fix - feat - perf All others WON'T publish a release. You can however tweak the configuration to make it workEsteban
C
0

If you can't get this work you will have to add this to your config releaseRules:

    '@semantic-release/commit-analyzer',
    {
      preset: 'conventionalcommits',
      releaseRules: [
        { breaking: true, release: 'major' },

There are several issues related to this, and this is the only thing that worked for me. Here's my answer on issue-2765

Cairo answered 27/3 at 0:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.