Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent semantic release from being triggered by certain default prefixes #612

Open
Menosc opened this issue Mar 25, 2024 · 4 comments
Open

Comments

@Menosc
Copy link

Menosc commented Mar 25, 2024

Hi everyone! I'm currently using Semantic Release in my project and I'd like to configure it so that it doesn't trigger a release for commits labeled as fix or feat. However, I couldn't find a straightforward way to achieve this in the existing configuration options.

I propose adding a feature or configuration option that allows users to exclude specific commit types, by setting a certain prefix to false. I found an example for scopes.

Here is an example of my package.json file:

{
  "name": "semantic-release-image",
  "release": {
    "branches": ["main"],
    "plugins": [
      [
        "@semantic-release/commit-analyzer",
        {
          "releaseRules": [
            {
              "type": "feat",
              "release": "prerelease"
            },
            {
              "type": "feat",
              "scope": "release",
              "release": "minor"
            },
            {
              "type": "perf",
              "release": "prerelease"
            },
            {
              "type": "BREAKING CHANGE",
              "release": "major"
            },
            {
              "type": "revert",
              "release": "prerelease"
            },
            {
              "type": "fix",
              "release": "prerelease"
            }
          ],
          "parserOpts": {
            "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
          }
        }
      ]
      [
        "@semantic-release/github"
      ]
    ]
  }
}

As you can see, now I set those default prefixes to prerelease and that's not what I am aiming for.
If this feature exists, please, let me know how to achieve it.
Thanks in advance!

@travi
Copy link
Member

travi commented Mar 25, 2024

options for changing the commit convention are described here: https://semantic-release.gitbook.io/semantic-release#commit-message-format

if you need something more custom, you are likely needing to create your own custom preset

@hobbitronics
Copy link

You can also do this "commits that contains '[skip release]' or '[release skip]' in their message will be excluded from the commit analysis" @Menosc although not as convenient.

@hobbitronics
Copy link

hobbitronics commented Mar 26, 2024

You can also do this "commits that contains '[skip release]' or '[release skip]' in their message will be excluded from the commit analysis" @Menosc although not as convenient.

Another thing I do to skip a release is just not use Angular commit convention and the commit is ignored.

@Menosc
Copy link
Author

Menosc commented Mar 26, 2024

@travi @hobbitronics thank you guys! I chose [skip release] as a quick fix for now. I do appreciate your answers. You helped a lot. I felt the lack of this information in the official documentation. Is it worth adding it there? If yes, I can do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants