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
-
objectGithubActionWriter
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
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
githubActionGithubActionThe workflow model to serialize.