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

Function AddWorkflows

pkg/cli/add_command.go:209–217  ·  view source on GitHub ↗

AddWorkflows adds one or more workflows from components to .github/workflows with optional repository installation and PR creation. Returns AddWorkflowsResult containing PR number (if created) and other metadata.

(ctx context.Context, workflows []string, opts AddOptions)

Source from the content-addressed store, hash-verified

207// with optional repository installation and PR creation.
208// Returns AddWorkflowsResult containing PR number (if created) and other metadata.
209func AddWorkflows(ctx context.Context, workflows []string, opts AddOptions) (*AddWorkflowsResult, error) {
210 // Resolve workflows first - fetches content directly from GitHub
211 resolved, err := ResolveWorkflows(ctx, workflows, opts.Verbose)
212 if err != nil {
213 return nil, err
214 }
215
216 return AddResolvedWorkflows(ctx, workflows, resolved, opts)
217}
218
219// AddResolvedWorkflows adds workflows using pre-resolved workflow data.
220// This allows callers to resolve workflows early (e.g., to show descriptions) and then add them later.

Calls 2

ResolveWorkflowsFunction · 0.85
AddResolvedWorkflowsFunction · 0.85