Class Tex
- Namespace
- Invex.StructuredText.Expressions
- Assembly
- Invex.StructuredText.dll
The starting point for writing expressions. Everything that creates an expression from scratch lives here:
references (Secret(string), JobOutput(string, string, string?), …), status checks (Success(), …),
functions (All(params IEnumerable<BoolExpr>), Format(StringExpr, params IEnumerable<Expr>), …) and the escape hatch Raw(string).
Platform packages add their own members, such as Tex.GitHub for the GitHub Actions contexts.
public static class Tex
- Inheritance
-
objectTex
Remarks
Once you have an expression, its own members do the rest: Eq, Contains, StartsWith, the
&&, || and ! operators, and indexers for JSON values. Add
using static Invex.StructuredText.Expressions.Tex; to drop the Tex. prefix.
Properties
Null
The null literal.
public static JsonExpr Null { get; }
Property Value
Methods
All(params IEnumerable<BoolExpr>)
True when every condition is true. Equivalent to chaining &&.
public static BoolExpr All(params IEnumerable<BoolExpr> conditions)
Parameters
conditionsIEnumerable<BoolExpr>One or more conditions.
Returns
Always()
Always true, even after failures or cancellation.
public static BoolExpr Always()
Returns
Any(params IEnumerable<BoolExpr>)
True when any condition is true. Equivalent to chaining ||.
public static BoolExpr Any(params IEnumerable<BoolExpr> conditions)
Parameters
conditionsIEnumerable<BoolExpr>One or more conditions.
Returns
Cancelled()
True when the run was cancelled.
public static BoolExpr Cancelled()
Returns
Failure()
True when any previous work failed.
public static BoolExpr Failure()
Returns
Format(StringExpr, params IEnumerable<Expr>)
Replaces {0}, {1}, … in format with arguments.
public static StringExpr Format(StringExpr format, params IEnumerable<Expr> arguments)
Parameters
formatStringExprThe format string.
argumentsIEnumerable<Expr>The replacement values.
Returns
FromJson(StringExpr)
Parses JSON text.
public static JsonExpr FromJson(StringExpr json)
Parameters
jsonStringExprThe JSON text.
Returns
HashFiles(params IEnumerable<StringExpr>)
Hashes the files matching the glob patterns.
public static StringExpr HashFiles(params IEnumerable<StringExpr> patterns)
Parameters
patternsIEnumerable<StringExpr>One or more glob patterns.
Returns
Input(string)
An input (parameter) supplied when the run was started.
public static StringExpr Input(string name)
Parameters
namestringThe input name.
Returns
JobOutput(string, string, string?)
An output of another job that the current job depends on.
public static StringExpr JobOutput(string job, string output, string? step = null)
Parameters
jobstringThe producing job's id.
outputstringThe output name.
stepstringThe id of the step that set the output, for platforms that need it.
Returns
JobResult(string)
The result of another job that the current job depends on.
public static StringExpr JobResult(string job)
Parameters
jobstringThe job id.
Returns
Join(string, IEnumerable<Template>)
Joins templates with separator between each.
public static Template Join(string separator, IEnumerable<Template> templates)
Parameters
separatorstringThe literal separator.
templatesIEnumerable<Template>The templates to join.
Returns
- Template
The joined template.
Matrix(string)
The current value of a matrix dimension.
public static StringExpr Matrix(string name)
Parameters
namestringThe dimension name.
Returns
Raw(string)
Verbatim expression text, written exactly as given. It works as a condition and converts implicitly to string, number and JSON expressions. Prefer typed members where they exist.
public static RawExpr Raw(string text)
Parameters
textstringThe expression text.
Returns
Result(RunResult)
A result value to compare with JobResult(string), spelled the platform's way.
public static StringExpr Result(RunResult result)
Parameters
resultRunResultThe result.
Returns
Secret(string)
A secret.
public static StringExpr Secret(string name)
Parameters
namestringThe secret name.
Returns
StepOutput(string, string)
An output of an earlier step in the current job.
public static StringExpr StepOutput(string step, string output)
Parameters
stepstringThe step id.
outputstringThe output name.
Returns
Success()
True when all previous work succeeded. Usually the platform default.
public static BoolExpr Success()
Returns
Variable(string)
A configuration variable defined outside the workflow.
public static StringExpr Variable(string name)
Parameters
namestringThe variable name.