Skip to content

Commit abb2bfa

Browse files
authored
Merge pull request #3628 from BinToss/bintoss/fixConventionalCommitPatchRule
docs: fix Conventional Commits PATCH rule
2 parents e62e50f + 7a388f7 commit abb2bfa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/input/docs/reference/version-increments.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,18 @@ you can leverage this feature as follows:
9595

9696
```yaml
9797
mode: MainLine # Only add this if you want every version to be created automatically on your main branch.
98-
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
99-
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
100-
patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"
98+
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-,/\\\\]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
99+
minor-version-bump-message: "^(feat)(\\([\\w\\s-,/\\\\]*\\))?:"
100+
patch-version-bump-message: "^(fix|perf)(\\([\\w\\s-,/\\\\]*\\))?:"
101101
```
102102

103103
This will ensure that your version gets bumped according to the commits you've
104104
created.
105105

106+
If your CI/CD workflow uses semantic-release's commit-analyzer, change `(fix|perf)` to `(fix|perf|revert)`. [Why?](https://github.com/semantic-release/commit-analyzer/blob/75c9c87c88772d7ded4ca9614852b42519e41931/lib/default-release-rules.js#L8C1-L8C38)
107+
108+
Alternatively, you can override this rule in the [configuration](https://github.com/semantic-release/commit-analyzer/tree/master#usage) of \@semantic-release/commit-analyzer. If you intend to write rules with patterns, note that instead of using Regular Expression, \@semantic-release/commit-analyzer uses [micromatch's glob implementation](https://github.com/micromatch/micromatch#matching-features).
109+
106110
### GitVersion.yml
107111

108112
The first is by setting the `next-version` property in the GitVersion.yml file.
@@ -116,7 +120,7 @@ from the branch name as a source. However, GitVersion can't use the [branch
116120
name as a version source for _other branches_][faq-branch-name-source].
117121

118122
### Detached HEAD
119-
If HEAD is in detached state tag will be `-no-branch-`.
123+
If HEAD is in detached state tag will be `-no-branch-`.
120124

121125
Example: `0.0.1--no-branch-.1+4`
122126

0 commit comments

Comments
 (0)