semantic-release-fail-on-major-bump
Version:
Semantic release plugin that prevents publishing major version bumps
69 lines (49 loc) • 1.93 kB
Markdown
<div align="center">
<img alt="Icon" width="128" height="128" align="center" src=".github/icon.png"/>
**Semantic release plugin that prevents publishing major version bumps**
[](https://www.npmjs.com/package/semantic-release-fail-on-major-bump)
[](https://github.com/evelynhathaway/semantic-release-fail-on-major-bump/actions)
[](/LICENSE)
</div>
If you need your pipelines to fail if a major or breaking change release will be created with semantic-release, drop this plugin into your config.
```bash
npm install --save-dev semantic-release-fail-on-major-bump
```
In your [**semantic-release** configuration file](https://semantic-release.gitbook.io/semantic-release/usage/configuration#configuration-file), add `semantic-release-fail-on-major-bump`.
**`release.config.mjs`**
```js
export default {
plugins: [
// Add this line
"semantic-release-fail-on-major-bump",
// Example semantic-release commit-analyzer config below...
[
"@semantic-release/commit-analyzer",
{
"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 `Breaking:` or non-breaking typed commit and then see if the error was thrown if expected while running
a dummy dry-run release.
```bash
npm run test-release
```
Copyright Evelyn Hathaway, [MIT License](/LICENSE)