MCPcopy
hub / github.com/MaaEnd/MaaEnd / _github_auth_headers

Function _github_auth_headers

tools/setup_workspace.py:906–916  ·  view source on GitHub ↗

Return GitHub API auth headers, or None if no token is configured.

()

Source from the content-addressed store, hash-verified

904
905
906def _github_auth_headers() -> dict[str, str] | None:
907 """Return GitHub API auth headers, or None if no token is configured."""
908 token = os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN") or ""
909 token = token.strip()
910 if not token:
911 return None
912 return {
913 "Authorization": f"Bearer {token}",
914 "Accept": "application/vnd.github+json",
915 "X-GitHub-Api-Version": "2022-11-28",
916 }
917
918
919def _is_git_sha(version: str | None) -> bool:

Callers 1

install_cpp_algoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected