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)
| 207 | // with optional repository installation and PR creation. |
| 208 | // Returns AddWorkflowsResult containing PR number (if created) and other metadata. |
| 209 | func 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. |