MCPcopy Create free account
hub / github.com/Picrew/awesome-agent-harness / get_token

Function get_token

scripts/sync_github_metadata.py:37–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36
37def get_token() -> str | None:
38 env_token = os.getenv("GITHUB_TOKEN")
39 if env_token:
40 return env_token
41 try:
42 out = subprocess.check_output(["gh", "auth", "token"], text=True, stderr=subprocess.DEVNULL).strip()
43 return out or None
44 except Exception:
45 return None
46
47
48def fetch_repo(owner: str, repo: str, token: str | None) -> dict[str, Any]:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected