You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/input/docs/reference/configuration.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -484,7 +484,9 @@ values, but here they are if you need to:
484
484
### regex
485
485
486
486
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.
488
490
489
491
### source-branches
490
492
@@ -572,11 +574,13 @@ Same as for the [global configuration, explained above](#mode).
572
574
573
575
### label
574
576
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+)[-/].+'`.
580
584
581
585
**Note:** To clear a default use an empty string: `label: ''`
0 commit comments