A drop-in replacement for @semantic-release/commit-analyzer that fails when no release is made
If you need your pipelines to fail if no release will be created with semantic-release, drop this plugin into your config.
npm install --save-dev commit-analyzer-fail-on-no-releaseIn your semantic-release configuration file, replace the default commit analyzer with commit-analyzer-fail-on-no-release. All configuration options pass through to the default plugin.
release.config.mjs
export default {
plugins: [
[
- "@semantic-release/commit-analyzer",
+ "commit-analyzer-fail-on-no-release",
{
"preset": "angular",
"releaseRules": [
{"type": "docs", "scope": "README", "release": "patch"},
{"type": "refactor", "release": "patch"},
{"type": "style", "release": "patch"},
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"],
},
},
],
],
};Make a either a no commit, a typed commit that will release, or one that won't and then see if the error was thrown if expected while running a dummy dry-run release.
npm link
npm link commit-analyzer-fail-on-no-release
npm run test-releaseCopyright Evelyn Hathaway, MIT License