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/mdsource/configuration.source.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -504,6 +504,8 @@ of `alpha.foo` with `label: 'alpha.{BranchName}'` and `regex: '^features?[\/-](?
504
504
505
505
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+)[-/].+'`.
506
506
507
+
You can also use environment variable placeholders with the `{env:VARIABLE_NAME}` syntax. Environment variable placeholders can also be combined with regex placeholders, for example `{BranchName}-{env:VARIABLE_NAME}`, and support fallback values using the `{env:VARIABLE_NAME ?? "fallback"}` syntax.
508
+
507
509
**Note:** To clear a default use an empty string: `label: ''`
/// Formats the <paramref name="template"/>, replacing each expression wrapped in curly braces
49
+
/// with the corresponding property from the <paramref name="source"/> or <paramref name="environment"/>.
50
+
/// </summary>
51
+
/// <param name="source">The source object to apply to the <paramref name="template"/></param>
52
+
/// <param name="environment"></param>
53
+
/// <exception cref="ArgumentNullException">The <paramref name="template"/> is null.</exception>
54
+
/// <exception cref="ArgumentException">An environment variable was null and no fallback was provided.</exception>
55
+
/// <remarks>
56
+
/// An expression containing "." is treated as a property or field access on the <paramref name="source"/>.
57
+
/// An expression starting with "env:" is replaced with the value of the corresponding variable from the <paramref name="environment"/>.
58
+
/// Each expression may specify a single hardcoded fallback value using the {Prop ?? "fallback"} syntax, which applies if the expression evaluates to null.
59
+
/// </remarks>
60
+
/// <example>
61
+
/// // replace an expression with a property value
62
+
/// "Hello {Name}".FormatWith(new { Name = "Fred" }, env);
0 commit comments