{"record":{"id":"cce7826f009e0b15","repo":"stablyai/orca","slug":"github-repository-must-be-in-owner-repo-form-got","errorCode":null,"errorMessage":"GITHUB_REPOSITORY must be in owner/repo form, got \"${options.repo}\".","messagePattern":"GITHUB_REPOSITORY must be in owner/repo form, got \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-release-mac-build-workflow.mjs","lineNumber":149,"sourceCode":"      `Mac release build workflow is ${run.status}; polling again in ${options.pollSeconds}s`\n    )\n    await sleep(options.pollSeconds * 1000)\n  }\n\n  throw new Error(\n    `Timed out after ${options.timeoutMinutes}m waiting for mac release build workflow ${workflowRunId}.`\n  )\n}\n\nexport function createGitHubApiClient(options, deps = {}) {\n  const fetchImpl = deps.fetch ?? globalThis.fetch\n  if (typeof fetchImpl !== 'function') {\n    throw new Error('A fetch implementation is required.')\n  }\n\n  const [owner, repo] = options.repo.split('/')\n  if (!owner || !repo) {\n    throw new Error(`GITHUB_REPOSITORY must be in owner/repo form, got \"${options.repo}\".`)\n  }\n\n  return {\n    owner,\n    repo,\n    async request(method, path, body) {\n      const response = await fetchImpl(`${options.apiBaseUrl}${path}`, {\n        body: body == null ? undefined : JSON.stringify(body),\n        headers: {\n          Accept: 'application/vnd.github+json',\n          Authorization: `Bearer ${options.token}`,\n          'Content-Type': 'application/json',\n          'X-GitHub-Api-Version': DEFAULT_API_VERSION\n        },\n        method\n      })\n      const text = await response.text()\n      const data = text.length > 0 ? JSON.parse(text) : null","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-release-mac-build-workflow.mjs#L131-L167","documentation":"Thrown by createGitHubApiClient when options.repo (from GITHUB_REPOSITORY) does not split into a non-empty owner and repo via '/'. The client derives api.owner and api.repo from this single value, so a malformed value (missing slash, empty segment, extra slashes) is fatal.","triggerScenarios":"GITHUB_REPOSITORY is unset (caught earlier by requiredEnv), set to just 'orca', 'orca/', '/orca', 'a/b/c', or contains only whitespace such that owner or repo is empty after split.","commonSituations":"Running outside GitHub Actions where GITHUB_REPOSITORY is not auto-set, manual override with a typo, value copied with surrounding quotes/whitespace, fork rename not reflected.","solutions":["Set GITHUB_REPOSITORY to exactly owner/repo (e.g. anomaly/orca).","Trim whitespace and remove surrounding quotes from the env value.","If forking, point GITHUB_REPOSITORY at the fork's owner/repo that has the workflow."],"exampleFix":"# before\nGITHUB_REPOSITORY=orca\n# after\nGITHUB_REPOSITORY=anomaly/orca","handlingStrategy":"validation","validationCode":"const [owner, repo] = (env.GITHUB_REPOSITORY ?? '').split('/')\nif (!owner || !repo || owner.includes('/') || repo.includes('/')) {\n  throw new Error('Set GITHUB_REPOSITORY to owner/repo, e.g. anomaly/orca')\n}","typeGuard":"function isOwnerRepo(value) {\n  if (typeof value !== 'string') return false\n  const parts = value.split('/')\n  return parts.length === 2 && parts.every((p) => p.length > 0)\n}","tryCatchPattern":"try {\n  api = createGitHubApiClient(options)\n} catch (err) {\n  if (/GITHUB_REPOSITORY must be in owner/repo form/.test(err.message)) {\n    // fix the env var and reconstruct\n  }\n  throw err\n}","preventionTips":["Validate GITHUB_REPOSITORY format in a preflight before constructing the client.","Trim whitespace and strip quotes when reading the env var.","Document the expected owner/repo form at the script entrypoint."],"tags":["config","github","environment","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}