MCPcopy Index your code
hub / github.com/github/gh-aw / ExecGH

Function ExecGH

pkg/workflow/github_cli.go:79–82  ·  view source on GitHub ↗

ExecGH wraps gh CLI calls and ensures proper token configuration. It uses go-gh/v2 to execute gh commands when GH_TOKEN or GITHUB_TOKEN is available, otherwise falls back to direct exec.Command for backward compatibility. Usage: cmd := ExecGH("api", "/user") output, err := cmd.Output()

(args ...string)

Source from the content-addressed store, hash-verified

77// cmd := ExecGH("api", "/user")
78// output, err := cmd.Output()
79func ExecGH(args ...string) *exec.Cmd {
80 //nolint:staticcheck // Passing nil context to use exec.Command instead of exec.CommandContext
81 return setupGHCommand(nil, args...)
82}
83
84// ExecGHContext wraps gh CLI calls with context support and ensures proper token configuration.
85// Similar to ExecGH but accepts a context for cancellation and timeout support.

Callers 15

showTrialConfirmationFunction · 0.92
toggleWorkflowsByNamesFunction · 0.92
execGHAPIFunction · 0.92
ensureTrialRepositoryFunction · 0.92
createForkIfNeededFunction · 0.92
transferPRFunction · 0.92
RunWorkflowOnGitHubFunction · 0.92

Calls 1

setupGHCommandFunction · 0.70

Tested by 3

TestExecGHFunction · 0.56