Table of Contents

Class GithubActionWriter

Namespace
Invex.StructuredText.GithubActions
Assembly
Invex.StructuredText.GithubActions.dll

Serializes a GithubAction model to GitHub Actions workflow YAML. Expressions embedded in the model are rendered with GithubExpressionPrinter.

public sealed class GithubActionWriter
Inheritance
object
GithubActionWriter

Examples

var writer = new GithubActionWriter();
writer.Write(workflow);
File.WriteAllText(".github/workflows/ci.yml", writer.TextWriter.ToString());

Remarks

The writer accumulates output in TextWriter; call ToString() to retrieve the YAML. Use a fresh writer (or Reset(int)) for each workflow file.

Constructors

GithubActionWriter()

public GithubActionWriter()

Properties

TextWriter

The underlying text writer that accumulates the generated YAML.

public StructuredTextWriter TextWriter { get; init; }

Property Value

StructuredTextWriter

Methods

Write(GithubAction)

Writes the complete workflow YAML for githubAction — name, run-name, triggers, permissions, env, concurrency, and all jobs with their steps.

public void Write(GithubAction githubAction)

Parameters

githubAction GithubAction

The workflow model to serialize.