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

does not fail when commits message don't follow conventional commits #278

Closed
electriquo opened this issue Oct 17, 2021 · 3 comments
Closed
Labels

Comments

@electriquo
Copy link

electriquo commented Oct 17, 2021

This is a snippet from my configuration

plugins: [
  ["@semantic-release/commit-analyzer", {
    preset: "conventionalcommits",
  }],
  ["@semantic-release/release-notes-generator", {
    preset: "conventionalcommits",
   }],
  ...

and and logs indicate that it was loaded

semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: { preset: 'conventionalcommits' }
[semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: foo
semantic-release:commit-analyzer Analyzing with default rules +0ms
[@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[@semantic-release/commit-analyzer] › ℹ  Analysis of 1 commits complete: no release
› ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"

If it matters have installed conventional-changelog-conventionalcommits.

I would expect the plugin to fail semantic release when the git commit message history contains a commit that does not follow conventional commit.

In the documentation it is written

For presets that expects a configuration object, such as conventionalcommits, the presetConfig option must be set.

maybe this is the reason that the plugin does not fail (what should be the presetConfig?).

What am I missing? Is this a bug?

Thank you

@gr2m
Copy link
Member

gr2m commented Oct 17, 2021

I would expect the plugin to fail semantic release when the git commit message history contains a commit that does not follow conventional commit.

This is by design. We don't enforce that all commits have to follow the specified conventions, it would be too late for it anyway, the commits exist in the releasing branch at this point. It's something you might want to check for before you push commits into a branch that semantic-release runs on, some folks like to use https://github.com/zeke/semantic-pull-requests for that purpose.

@gr2m gr2m closed this as completed Oct 17, 2021
@gr2m gr2m added the support label Oct 17, 2021
@electriquo
Copy link
Author

@gr2m Thank you. Could you share information regarding the presetConfig?

@dargmuesli
Copy link

Seems like it is enough to set presetConfig: {}.

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

No branches or pull requests

3 participants