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

Function compileAddedWorkflow

pkg/cli/add_command.go:403–424  ·  view source on GitHub ↗
(ctx context.Context, destFile string, workflowSpec *WorkflowSpec, githubWorkflowsDir string, tracker *FileTracker, opts AddOptions)

Source from the content-addressed store, hash-verified

401}
402
403func 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
426func validateWorkflowSecurity(resolved *ResolvedWorkflow, opts AddOptions) error {
427 if !opts.DisableSecurityScanner {

Callers 1

addWorkflowWithTrackingFunction · 0.85

Tested by

no test coverage detected