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

Function renderCopilotSetupUpdateInstructions

pkg/cli/copilot_setup.go:261–286  ·  view source on GitHub ↗

renderCopilotSetupUpdateInstructions renders console instructions for updating copilot-setup-steps.yml

(ctx context.Context, filePath string, actionMode workflow.ActionMode, version string, resolver workflow.SHAResolver)

Source from the content-addressed store, hash-verified

259
260// renderCopilotSetupUpdateInstructions renders console instructions for updating copilot-setup-steps.yml
261func 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.

Callers 1

Calls 4

FormatInfoMessageStderrFunction · 0.92
getActionRefFunction · 0.85
IsReleaseMethod · 0.80
IsActionMethod · 0.80

Tested by

no test coverage detected