GetInstallationSteps returns the GitHub Actions steps needed to install Crush CLI
(workflowData *WorkflowData)
| 64 | |
| 65 | // GetInstallationSteps returns the GitHub Actions steps needed to install Crush CLI |
| 66 | func (e *CrushEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep { |
| 67 | crushLog.Printf("Generating installation steps for Crush engine: workflow=%s", workflowData.Name) |
| 68 | |
| 69 | // Skip installation if custom command is specified |
| 70 | if workflowData.EngineConfig != nil && workflowData.EngineConfig.Command != "" { |
| 71 | crushLog.Printf("Skipping installation steps: custom command specified (%s)", workflowData.EngineConfig.Command) |
| 72 | return []GitHubActionStep{} |
| 73 | } |
| 74 | |
| 75 | // Use version from engine config if provided, otherwise default to pinned version |
| 76 | version := string(constants.DefaultCrushVersion) |
| 77 | if workflowData.EngineConfig != nil && workflowData.EngineConfig.Version != "" { |
| 78 | version = workflowData.EngineConfig.Version |
| 79 | } |
| 80 | |
| 81 | // Crush requires post-install scripts (native binaries) so --ignore-scripts must |
| 82 | // NOT be passed. This is intentionally different from other engine installs. |
| 83 | npmSteps := GenerateNpmInstallSteps( |
| 84 | "@charmland/crush", |
| 85 | version, |
| 86 | "Install Crush CLI", |
| 87 | "crush", |
| 88 | true, // Include Node.js setup |
| 89 | true, // Crush requires post-install scripts for native binaries |
| 90 | resolveRuntimeCooldown(workflowData, "node"), |
| 91 | ) |
| 92 | |
| 93 | // Run crush --version to verify the installation and force any deferred binary downloads |
| 94 | commandName := "crush" |
| 95 | if workflowData.EngineConfig != nil && workflowData.EngineConfig.Command != "" { |
| 96 | commandName = workflowData.EngineConfig.Command |
| 97 | } |
| 98 | versionStep := GitHubActionStep{ |
| 99 | " - name: Verify Crush CLI installation", |
| 100 | " run: " + commandName + " --version", |
| 101 | } |
| 102 | npmSteps = append(npmSteps, versionStep) |
| 103 | |
| 104 | return BuildNpmEngineInstallStepsWithAWF(npmSteps, workflowData) |
| 105 | } |
| 106 | |
| 107 | // GetSecretValidationStep returns the secret validation step for the Crush engine. |
| 108 | // Returns an empty step if permissions.copilot-requests is write (uses GitHub Actions token). |