{"record":{"id":"2d8b4e23f5109926","repo":"oven-sh/bun","slug":"github-api-returned-res-status-cannot-determin","errorCode":null,"errorMessage":"GitHub API returned ${res.status}; cannot determine changed files","messagePattern":"GitHub API returned (.+?); cannot determine changed files","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/runner.node.mjs","lineNumber":258,"sourceCode":"      console.error(\"Failed to parse pr-*-files meta-data:\", e);\n      allFiles = [];\n      newFiles = [];\n    }\n  }\n  if (allFiles.length === 0) {\n    try {\n      console.log(\"on buildkite: collecting new files from PR\");\n      const per_page = 50;\n      const { BUILDKITE_PULL_REQUEST } = process.env;\n      for (let i = 1; i <= 10; i++) {\n        const res = await fetch(\n          `https://api.github.com/repos/oven-sh/bun/pulls/${BUILDKITE_PULL_REQUEST}/files?per_page=${per_page}&page=${i}`,\n          { headers: { Authorization: `Bearer ${getSecret(\"GITHUB_TOKEN\")}` } },\n        );\n        const doc = await res.json();\n        if (!res.ok || !Array.isArray(doc)) {\n          console.error(`-> page ${i}: GitHub API ${res.status} ${res.statusText}:`, JSON.stringify(doc));\n          throw new Error(`GitHub API returned ${res.status}; cannot determine changed files`);\n        }\n        console.log(`-> page ${i}, found ${doc.length} items`);\n        if (doc.length === 0) break;\n        for (const { filename, status } of doc) {\n          prFileCount += 1;\n          allFiles.push(filename);\n          if (status !== \"added\") continue;\n          newFiles.push(filename);\n        }\n        if (doc.length < per_page) break;\n      }\n      console.log(`- PR ${BUILDKITE_PULL_REQUEST}, ${prFileCount} files, ${newFiles.length} new files`);\n    } catch (e) {\n      console.error(e);\n    }\n  }\n}\n","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/runner.node.mjs#L240-L276","documentation":"Error \"GitHub API returned ${res.status}; cannot determine changed files\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at scripts/runner.node.mjs:258 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":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}