(ctx context.Context, destFile string, workflowSpec *WorkflowSpec, githubWorkflowsDir string, tracker *FileTracker, opts AddOptions)
| 401 | } |
| 402 | |
| 403 | func compileAddedWorkflow(ctx context.Context, destFile string, workflowSpec *WorkflowSpec, githubWorkflowsDir string, tracker *FileTracker, opts AddOptions) { |
| 404 | // For remote workflows: now that the main workflow and all its imports are on disk, |
| 405 | // parse the fully merged safe-outputs configuration to discover any dispatch workflows |
| 406 | // that originate from imported shared workflows (not visible in the raw frontmatter). |
| 407 | if !isLocalWorkflowPath(workflowSpec.WorkflowPath) { |
| 408 | fetchAndSaveDispatchWorkflowsFromParsedFile(destFile, workflowSpec, githubWorkflowsDir, opts.Verbose, opts.Force, tracker) |
| 409 | } |
| 410 | // Compile any dispatch-workflow .md dependencies that were just fetched and lack a |
| 411 | // .lock.yml. The dispatch-workflow validator requires every .md dispatch target to be |
| 412 | // compiled before the main workflow can be validated. |
| 413 | compileDispatchWorkflowDependencies(ctx, destFile, opts.Verbose, opts.Quiet, opts.EngineOverride, tracker) |
| 414 | // Compile the workflow |
| 415 | if tracker != nil { |
| 416 | if err := compileWorkflowWithTracking(ctx, destFile, opts.Verbose, opts.Quiet, opts.EngineOverride, tracker); err != nil { |
| 417 | printCompilationError(err, opts.Quiet) |
| 418 | } |
| 419 | return |
| 420 | } |
| 421 | if err := compileWorkflow(ctx, destFile, opts.Verbose, opts.Quiet, opts.EngineOverride); err != nil { |
| 422 | printCompilationError(err, opts.Quiet) |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | func validateWorkflowSecurity(resolved *ResolvedWorkflow, opts AddOptions) error { |
| 427 | if !opts.DisableSecurityScanner { |
no test coverage detected