renderCopilotSetupUpdateInstructions renders console instructions for updating copilot-setup-steps.yml
(ctx context.Context, filePath string, actionMode workflow.ActionMode, version string, resolver workflow.SHAResolver)
| 259 | |
| 260 | // renderCopilotSetupUpdateInstructions renders console instructions for updating copilot-setup-steps.yml |
| 261 | func renderCopilotSetupUpdateInstructions(ctx context.Context, filePath string, actionMode workflow.ActionMode, version string, resolver workflow.SHAResolver) { |
| 262 | fmt.Fprintln(os.Stderr) |
| 263 | fmt.Fprintln(os.Stderr, console.FormatInfoMessageStderr("Existing file detected: "+filePath)) |
| 264 | fmt.Fprintln(os.Stderr) |
| 265 | fmt.Fprintln(os.Stderr, "To enable GitHub Copilot Agent integration, please add the following steps") |
| 266 | fmt.Fprintln(os.Stderr, "to the 'copilot-setup-steps' job in your .github/workflows/copilot-setup-steps.yml file:") |
| 267 | fmt.Fprintln(os.Stderr) |
| 268 | |
| 269 | // Determine the action reference |
| 270 | actionRef := getActionRef(ctx, actionMode, version, resolver) |
| 271 | |
| 272 | if actionMode.IsRelease() || actionMode.IsAction() { |
| 273 | actionRepo := "github/gh-aw-actions/setup-cli" |
| 274 | fmt.Fprintln(os.Stderr, " - name: Checkout repository") |
| 275 | fmt.Fprintln(os.Stderr, " uses: actions/checkout@v6") |
| 276 | fmt.Fprintln(os.Stderr, " - name: Install gh-aw extension") |
| 277 | fmt.Fprintln(os.Stderr, " uses: "+actionRepo+actionRef) |
| 278 | fmt.Fprintln(os.Stderr, " with:") |
| 279 | fmt.Fprintln(os.Stderr, " version: "+version) |
| 280 | } else { |
| 281 | fmt.Fprintln(os.Stderr, " - name: Install gh-aw extension") |
| 282 | fmt.Fprintln(os.Stderr, " run: |") |
| 283 | fmt.Fprintln(os.Stderr, " curl -fsSL https://raw.githubusercontent.com/github/gh-aw/refs/heads/main/install-gh-aw.sh | bash") |
| 284 | } |
| 285 | fmt.Fprintln(os.Stderr) |
| 286 | } |
| 287 | |
| 288 | // setupCliUsesPattern matches the uses: line for either github/gh-aw/actions/setup-cli |
| 289 | // or github/gh-aw-actions/setup-cli. |
no test coverage detected