MCPcopy Create free account
hub / github.com/anthropics/claude-code / githubRequest

Function githubRequest

scripts/backfill-duplicate-comments.ts:26–45  ·  view source on GitHub ↗
(endpoint: string, token: string, method: string = 'GET', body?: any)

Source from the content-addressed store, hash-verified

24}
25
26async function githubRequest<T>(endpoint: string, token: string, method: string = 'GET', body?: any): Promise<T> {
27 const response = await fetch(`https://api.github.com${endpoint}`, {
28 method,
29 headers: {
30 Authorization: `Bearer ${token}`,
31 Accept: "application/vnd.github.v3+json",
32 "User-Agent": "backfill-duplicate-comments-script",
33 ...(body && { "Content-Type": "application/json" }),
34 },
35 ...(body && { body: JSON.stringify(body) }),
36 });
37
38 if (!response.ok) {
39 throw new Error(
40 `GitHub API request failed: ${response.status} ${response.statusText}`
41 );
42 }
43
44 return response.json();
45}
46
47async function triggerDedupeWorkflow(
48 owner: string,

Callers 2

triggerDedupeWorkflowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected