MCPcopy Create free account
hub / github.com/github/gh-aw / addEngineToWorkflow

Function addEngineToWorkflow

pkg/cli/add_workflow_compilation.go:180–184  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
180func 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}

Callers 2

TestAddEngineToWorkflowFunction · 0.85

Calls 1

addFieldToFrontmatterFunction · 0.85

Tested by 1

TestAddEngineToWorkflowFunction · 0.68