MCPcopy
hub / github.com/ericc-ch/copilot-api / getGitHubUser

Function getGitHubUser

src/services/github/get-user.ts:5–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { state } from "~/lib/state"
4
5export async function getGitHubUser() {
6 const response = await fetch(`${GITHUB_API_BASE_URL}/user`, {
7 headers: {
8 authorization: `token ${state.githubToken}`,
9 ...standardHeaders(),
10 },
11 })
12
13 if (!response.ok) throw new HTTPError("Failed to get GitHub user", response)
14
15 return (await response.json()) as GithubUserResponse
16}
17
18// Trimmed for the sake of simplicity
19interface GithubUserResponse {

Callers 1

logUserFunction · 0.90

Calls 1

standardHeadersFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…