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

Function appendRepoFlagFromEnv

pkg/cli/mcp_tools_privileged.go:30–35  ·  view source on GitHub ↗

appendRepoFlagFromEnv appends "--repo " to args when GITHUB_REPOSITORY is set in the environment. This allows gh CLI subcommands to identify the repository without falling back to git-based detection, which fails in sandboxed environments (e.g., MCP server containers where git is not ins

(args []string)

Source from the content-addressed store, hash-verified

28// GITHUB_REPOSITORY is forwarded to the agentic-workflows MCP server container via
29// env_vars in the MCP configuration and inherited by spawned subprocesses.
30func appendRepoFlagFromEnv(args []string) []string {
31 if repo := os.Getenv("GITHUB_REPOSITORY"); repo != "" {
32 return append(args, "--repo", repo)
33 }
34 return args
35}
36
37// logsArgs holds the input parameters for the logs tool.
38type logsArgs struct {

Callers 3

registerLogsToolFunction · 0.85
registerAuditToolFunction · 0.85
registerAuditDiffToolFunction · 0.85

Calls 1

GetenvMethod · 0.80

Tested by

no test coverage detected