@@ -141,6 +141,70 @@ refactor!: drop support for Node 6
141141
142142If no keywords are specified a ** Patch** bump is applied.
143143
144+ ### Scheme: Custom (YAML)
145+
146+ A user-defined scheme can be supplied via a YAML file using the ` --scheme-file ` flag. This is
147+ useful when neither the autotag nor Conventional Commits scheme fits your project's commit
148+ conventions.
149+
150+ ` --scheme-file ` is mutually exclusive with an explicitly non-default ` --scheme ` : pass one or the
151+ other. Ready-to-copy reference schemes are available under
152+ [ ` examples/schemes/ ` ] ( examples/schemes/ ) .
153+
154+ #### YAML schema
155+
156+ ``` yaml
157+ name : my-custom-scheme # required: identifier used in logs
158+ description : Optional summary. # optional: free-form
159+
160+ # Rules are evaluated in declaration order. The first rule whose regex matches
161+ # the commit message determines the bump. Remaining rules are not consulted.
162+ rules :
163+ - name : breaking-footer # optional: shown in validation errors
164+ match : ' (?m)^BREAKING CHANGE:'
165+ bump : major
166+ - name : feat
167+ match : ' ^feat(\([^)]*\))?:'
168+ bump : minor
169+ - name : patch-types
170+ match : ' ^(fix|chore|docs|refactor)(\([^)]*\))?:'
171+ bump : patch
172+
173+ # Required. What to do when no rule matches a commit.
174+ # Allowed values: major | minor | patch | none
175+ default : patch
176+ ` ` `
177+
178+ - ` match` is a Go [regexp](https://pkg.go.dev/regexp/syntax) pattern.
179+ - ` bump` and `default` must be one of `major`, `minor`, `patch`, or `none`.
180+ - A rule with `bump : none` matches the commit but contributes no version change — useful for
181+ explicitly ignoring commits (e.g., merge commits) without falling through to the default.
182+ - `default : none` combined with `--strict-match` will cause unmatched commits to error out instead
183+ of being silently ignored.
184+
185+ All validation (regex compilation, allowed bump values, required fields, unknown keys) happens at
186+ load time, so a malformed scheme fails fast with a clear error before any commits are parsed.
187+
188+ # ### Example
189+
190+ Given a scheme file `./my-scheme.yaml` :
191+
192+ ` ` ` yaml
193+ name: my-scheme
194+ rules:
195+ - match: '(?m)^BREAKING CHANGE:'
196+ bump: major
197+ - match: '^feat:'
198+ bump: minor
199+ default: patch
200+ ` ` `
201+
202+ Invoke autotag with :
203+
204+ ` ` ` sh
205+ autotag --scheme-file ./my-scheme.yaml
206+ ` ` `
207+
144208# ## Strict Match Option
145209
146210The `--strict-match` option enforces that commit messages must strictly adhere to the specified commit message scheme.
@@ -164,6 +228,13 @@ When the `--strict-match` option is enabled, the behavior of the commit message
164228 - With `--strict-match` : Commit messages that do not follow the conventional commit format will result in an
165229 error, and the commit will not be processed.
166230
231+ - **Custom (YAML) Scheme**:
232+ - Without `--strict-match` : Unmatched commits use the scheme's `default` value. When `default:
233+ none`, those commits contribute no version change.
234+ - With `--strict-match` : Unmatched commits (no rule matches **and** the scheme declares `default:
235+ none`) result in an error. If the scheme's `default` is `major`, `minor`, or `patch`, the
236+ fallback is always taken and strict-match never fires.
237+
167238# ### Usage
168239
169240To use the strict match option, add the `--strict-match` flag when running the autotag tool :
0 commit comments