Table of Contents

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
object
Tex

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

JsonExpr

Methods

All(params IEnumerable<BoolExpr>)

True when every condition is true. Equivalent to chaining &&.

public static BoolExpr All(params IEnumerable<BoolExpr> conditions)

Parameters

conditions IEnumerable<BoolExpr>

One or more conditions.

Returns

BoolExpr

Always()

Always true, even after failures or cancellation.

public static BoolExpr Always()

Returns

BoolExpr

Any(params IEnumerable<BoolExpr>)

True when any condition is true. Equivalent to chaining ||.

public static BoolExpr Any(params IEnumerable<BoolExpr> conditions)

Parameters

conditions IEnumerable<BoolExpr>

One or more conditions.

Returns

BoolExpr

Cancelled()

True when the run was cancelled.

public static BoolExpr Cancelled()

Returns

BoolExpr

Failure()

True when any previous work failed.

public static BoolExpr Failure()

Returns

BoolExpr

Format(StringExpr, params IEnumerable<Expr>)

Replaces {0}, {1}, … in format with arguments.

public static StringExpr Format(StringExpr format, params IEnumerable<Expr> arguments)

Parameters

format StringExpr

The format string.

arguments IEnumerable<Expr>

The replacement values.

Returns

StringExpr

FromJson(StringExpr)

Parses JSON text.

public static JsonExpr FromJson(StringExpr json)

Parameters

json StringExpr

The JSON text.

Returns

JsonExpr

HashFiles(params IEnumerable<StringExpr>)

Hashes the files matching the glob patterns.

public static StringExpr HashFiles(params IEnumerable<StringExpr> patterns)

Parameters

patterns IEnumerable<StringExpr>

One or more glob patterns.

Returns

StringExpr

Input(string)

An input (parameter) supplied when the run was started.

public static StringExpr Input(string name)

Parameters

name string

The input name.

Returns

StringExpr

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

job string

The producing job's id.

output string

The output name.

step string

The id of the step that set the output, for platforms that need it.

Returns

StringExpr

JobResult(string)

The result of another job that the current job depends on.

public static StringExpr JobResult(string job)

Parameters

job string

The job id.

Returns

StringExpr

Join(string, IEnumerable<Template>)

Joins templates with separator between each.

public static Template Join(string separator, IEnumerable<Template> templates)

Parameters

separator string

The literal separator.

templates IEnumerable<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

name string

The dimension name.

Returns

StringExpr

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

text string

The expression text.

Returns

RawExpr

Result(RunResult)

A result value to compare with JobResult(string), spelled the platform's way.

public static StringExpr Result(RunResult result)

Parameters

result RunResult

The result.

Returns

StringExpr

Secret(string)

A secret.

public static StringExpr Secret(string name)

Parameters

name string

The secret name.

Returns

StringExpr

StepOutput(string, string)

An output of an earlier step in the current job.

public static StringExpr StepOutput(string step, string output)

Parameters

step string

The step id.

output string

The output name.

Returns

StringExpr

Success()

True when all previous work succeeded. Usually the platform default.

public static BoolExpr Success()

Returns

BoolExpr

Variable(string)

A configuration variable defined outside the workflow.

public static StringExpr Variable(string name)

Parameters

name string

The variable name.

Returns

StringExpr