MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / upstream_file

Function upstream_file

scripts/audit-license-provenance.py:77–90  ·  view source on GitHub ↗
(repo, path, ref=None)

Source from the content-addressed store, hash-verified

75
76
77def upstream_file(repo, path, ref=None):
78 url = f"repos/{repo}/contents/{path}"
79 if ref:
80 url += f"?ref={ref}"
81 out = gh_api(url)
82 if not out:
83 return None
84 try:
85 d = json.loads(out)
86 if isinstance(d, dict) and d.get("content"):
87 return base64.b64decode(d["content"]).decode("utf-8", "replace")
88 except Exception:
89 pass
90 return None
91
92
93def local_license(dirpath):

Callers 1

check_upstreamFunction · 0.85

Calls 1

gh_apiFunction · 0.85

Tested by

no test coverage detected