Skip to content

Commit 1df77ed

Browse files
Casper Schmidt Wandahl-Liperarturcic
authored andcommitted
Update docs
1 parent a1b45fa commit 1df77ed

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docs/input/docs/reference/configuration.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,9 @@ values, but here they are if you need to:
484484
### regex
485485

486486
This is the regex which is used to match the current branch to the correct
487-
branch configuration.
487+
branch configuration.
488+
489+
[Named groups](https://learn.microsoft.com/en-us/dotnet/standard/base-types/grouping-constructs-in-regular-expressions#named-matched-subexpressions) can be used to dynamically label pre-releases based on the branch name, or parts of it. See [Label](#label) for more details and examples.
488490

489491
### source-branches
490492

@@ -572,11 +574,13 @@ Same as for the [global configuration, explained above](#mode).
572574

573575
### label
574576

575-
The pre release label to use for this branch. Use the value `useBranchName` to use
576-
the branch name instead. For example `feature/foo` would become a pre-release
577-
label of `foo` with this value. Use the value `{BranchName}` as a placeholder to
578-
insert the branch name. For example `feature/foo` would become a pre-release label
579-
of `alpha.foo` with the value of `alpha.{BranchName}`.
577+
The pre-release label to use for this branch. Use the value `{BranchName}` as a placeholder to
578+
insert the value of the named group `BranchName` from the [regular expression](#regex).
579+
580+
For example: branch `feature/foo` would become a pre-release label
581+
of `alpha.foo` with `label: 'alpha.{BranchName}'` and `regex: '^features?[/-](?<BranchName>.+)'`.
582+
583+
Another example: branch `features/sc-12345/some-description` would become a pre-release label of `sc-12345` with `label: '{StoryNo}'` and `regex: '^features?[/-](?<StoryNo>sc-\d+)[-/].+'`.
580584

581585
**Note:** To clear a default use an empty string: `label: ''`
582586

0 commit comments

Comments
 (0)