addActionWorkflowWithTracking installs a raw GitHub Actions YAML workflow file (.yml) directly to the target directory without any frontmatter processing or compilation.
(resolved *ResolvedWorkflow, tracker *FileTracker, opts AddOptions, githubWorkflowsDir, workflowName string)
| 667 | // addActionWorkflowWithTracking installs a raw GitHub Actions YAML workflow file (.yml) |
| 668 | // directly to the target directory without any frontmatter processing or compilation. |
| 669 | func addActionWorkflowWithTracking(resolved *ResolvedWorkflow, tracker *FileTracker, opts AddOptions, githubWorkflowsDir, workflowName string) error { |
| 670 | destFile := filepath.Join(githubWorkflowsDir, workflowName+".yml") |
| 671 | |
| 672 | addLog.Printf("Adding action workflow: dest=%s, content_size=%d bytes", destFile, len(resolved.Content)) |
| 673 | |
| 674 | if opts.Verbose { |
| 675 | fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Adding action workflow: "+destFile)) |
| 676 | } |
| 677 | |
| 678 | fileExists := false |
| 679 | if fileutil.FileExists(destFile) { |
| 680 | fileExists = true |
| 681 | if !opts.Force { |
| 682 | if opts.FromWildcard { |
| 683 | fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Action workflow '%s' already exists. Skipping.", workflowName+".yml"))) |
| 684 | return nil |
| 685 | } |
| 686 | return fmt.Errorf("action workflow '%s' already exists in %s. Use --force to overwrite", workflowName+".yml", githubWorkflowsDir) |
| 687 | } |
| 688 | fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Overwriting existing file: "+destFile)) |
| 689 | } |
| 690 | |
| 691 | if tracker != nil { |
| 692 | if fileExists { |
| 693 | tracker.TrackModified(destFile) |
| 694 | } else { |
| 695 | tracker.TrackCreated(destFile) |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | if err := os.WriteFile(destFile, resolved.Content, constants.FilePermPublic); err != nil { |
| 700 | return fmt.Errorf("failed to write action workflow file '%s': %w", destFile, err) |
| 701 | } |
| 702 | |
| 703 | if !opts.Quiet { |
| 704 | fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Added action workflow: "+filepath.Base(destFile))) |
| 705 | } |
| 706 | |
| 707 | return nil |
| 708 | } |
| 709 | |
| 710 | // addSkillFileWithTracking installs a single skill file from a package to the agentic engine |
| 711 | // skill directory. The file's path relative to the skill directory is preserved so that |
no test coverage detected