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

Function processWorkflowContentModifications

pkg/cli/add_command.go:500–520  ·  view source on GitHub ↗
(content string, workflowSpec *WorkflowSpec, sourceInfo *FetchedWorkflow, githubWorkflowsDir string, opts AddOptions)

Source from the content-addressed store, hash-verified

498}
499
500func processWorkflowContentModifications(content string, workflowSpec *WorkflowSpec, sourceInfo *FetchedWorkflow, githubWorkflowsDir string, opts AddOptions) (string, error) {
501 content, err := applyEngineAndPermissionModifications(content, opts)
502 if err != nil {
503 return content, err
504 }
505 content, err = applySourceAndIncludeModifications(content, workflowSpec, sourceInfo, githubWorkflowsDir, opts)
506 if err != nil {
507 return content, err
508 }
509 content, err = applyStopAfterModifications(content, opts)
510 if err != nil {
511 return content, err
512 }
513 if opts.AppendText != "" {
514 if !strings.HasSuffix(content, "\n") {
515 content += "\n"
516 }
517 content += "\n" + opts.AppendText
518 }
519 return content, nil
520}
521
522func applyEngineAndPermissionModifications(content string, opts AddOptions) (string, error) {
523 // Handle engine override - add/update the engine field in frontmatter before source so

Callers 1

addWorkflowWithTrackingFunction · 0.85

Tested by

no test coverage detected