addEngineToWorkflow adds or updates the engine field in the workflow's frontmatter. This function preserves the existing frontmatter formatting while setting the engine field. A trailing blank line is added after the engine declaration to visually separate it from the source field that follows, prev
(content, engine string)
| 178 | // A trailing blank line is added after the engine declaration to visually separate it from |
| 179 | // the source field that follows, preventing adjacent-line merge conflicts during updates. |
| 180 | func addEngineToWorkflow(content, engine string) (string, error) { |
| 181 | // Use shared frontmatter logic that preserves formatting; trailing blank line separates |
| 182 | // the engine declaration from the source field added immediately after. |
| 183 | return addFieldToFrontmatter(content, "engine", engine, true) |
| 184 | } |