(content string, workflowSpec *WorkflowSpec, sourceInfo *FetchedWorkflow, githubWorkflowsDir string, opts AddOptions)
| 498 | } |
| 499 | |
| 500 | func 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 | |
| 522 | func applyEngineAndPermissionModifications(content string, opts AddOptions) (string, error) { |
| 523 | // Handle engine override - add/update the engine field in frontmatter before source so |
no test coverage detected