MCPcopy Create free account
hub / github.com/JetBrains/skills / github_request

Function github_request

skill-installer/scripts/github_utils.py:10–17  ·  view source on GitHub ↗
(url: str, user_agent: str)

Source from the content-addressed store, hash-verified

8
9
10def github_request(url: str, user_agent: str) -> bytes:
11 headers = {"User-Agent": user_agent}
12 token = os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN")
13 if token:
14 headers["Authorization"] = f"token {token}"
15 req = urllib.request.Request(url, headers=headers)
16 with urllib.request.urlopen(req) as resp:
17 return resp.read()
18
19
20def github_api_contents_url(repo: str, path: str, ref: str) -> str:

Callers 2

_requestFunction · 0.90
_requestFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected