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

Function ExecGHContext

pkg/workflow/github_cli.go:91–93  ·  view source on GitHub ↗

ExecGHContext wraps gh CLI calls with context support and ensures proper token configuration. Similar to ExecGH but accepts a context for cancellation and timeout support. Usage: cmd := ExecGHContext(ctx, "api", "/user") output, err := cmd.Output()

(ctx context.Context, args ...string)

Source from the content-addressed store, hash-verified

89// cmd := ExecGHContext(ctx, "api", "/user")
90// output, err := cmd.Output()
91func ExecGHContext(ctx context.Context, args ...string) *exec.Cmd {
92 return setupGHCommand(ctx, args...)
93}
94
95// enrichGHError enriches an error returned from a gh CLI command with the
96// stderr output captured in *exec.ExitError. When cmd.Output() (stdout-only

Callers 15

queryActorRoleFunction · 0.92
createMCPServerFunction · 0.92
listRunArtifactNamesFunction · 0.92
downloadArtifactsByNameFunction · 0.92
retryCriticalArtifactsFunction · 0.92
downloadRunArtifactsFunction · 0.92
RunWorkflowOnGitHubFunction · 0.92
getRepositoryFunction · 0.92
resolveFromGitHubMethod · 0.70
peelTagObjectFunction · 0.70

Calls 1

setupGHCommandFunction · 0.70

Tested by 3

TestExecGHContextFunction · 0.56