toYamlFile
toYamlFile(
model:Model,path:string,options?:ToYamlOptions):void
Serialize a model to a YAML file.
Creates any intermediate directories that do not yet exist and writes the YAML output synchronously. This is a convenience wrapper around toYaml for the common “write to disk” use case.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
The model to serialize. |
|
|
|
Destination file path (absolute or relative to cwd). |
|
|
|
Optional settings forwarded to toYaml. |
Returns
Section titled “Returns”void
Example
Section titled “Example”toYamlFile(myWorkflow, ".github/workflows/ci.yml");
// With a custom header:toYamlFile(myAction, "action.yml", { header: "Generated by {tool} v{version}",});