{"record":{"id":"a3f9ea848486ae47","repo":"coleam00/Archon","slug":"cannot-reach-github-api-err-message","errorCode":null,"errorMessage":"Cannot reach GitHub API: ${err.message}","messagePattern":"Cannot reach GitHub API: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":5103,"sourceCode":"  type: 'file' | 'dir';\n  download_url: string | null;\n  path: string;\n}\n\n/** Fetch directory listing from GitHub Contents API at a pinned SHA. */\nasync function fetchGitHubDirectory(\n  owner: string,\n  repo: string,\n  path: string,\n  sha: string\n): Promise<GitHubContentItem[]> {\n  const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path}?ref=${sha}`;\n  let res: Response;\n  try {\n    res = await fetch(url, { headers: { Accept: 'application/vnd.github.v3+json' } });\n  } catch (error) {\n    const err = error as Error;\n    throw new Error(`Cannot reach GitHub API: ${err.message}`);\n  }\n  if (!res.ok) {\n    throw new Error(`GitHub API error: HTTP ${String(res.status)} from ${url}`);\n  }\n  const data: unknown = await res.json();\n  if (!Array.isArray(data)) {\n    throw new Error(`Expected directory listing from ${url}, got a single file`);\n  }\n  return data as GitHubContentItem[];\n}\n\n/** Download a file from raw.githubusercontent.com at a pinned SHA. */\nasync function downloadRawFile(\n  owner: string,\n  repo: string,\n  filePath: string,\n  sha: string\n): Promise<string> {","sourceCodeStart":5085,"sourceCodeEnd":5121,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L5085-L5121","documentation":"Error \"Cannot reach GitHub API: ${err.message}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/cli/src/commands/workflow.ts:5103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}