{"record":{"id":"96ec77770705ac1b","repo":"stablyai/orca","slug":"repo-is-required-96ec77","errorCode":null,"errorMessage":"repo is required","messagePattern":"repo is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/publish-complete-draft-releases.mjs","lineNumber":85,"sourceCode":"    `https://api.github.com/repos/${repo}/releases?per_page=100`,\n    token\n  )\n  if (!Array.isArray(releases)) {\n    throw new Error(`GitHub releases response for ${repo} was not an array`)\n  }\n  return releases\n}\n\nexport async function publishCompleteDraftReleases({\n  repo,\n  token,\n  fetchImpl = fetch,\n  verifyReleaseAssets = verifyRequiredReleaseAssets,\n  isDraftBuiltFromCurrentRef = ({ tag }) => isTagBuiltFromCurrentRef(tag),\n  log = console.log\n}) {\n  if (!repo) {\n    throw new Error('repo is required')\n  }\n  if (!token) {\n    throw new Error('token is required')\n  }\n\n  const releases = await fetchReleases(repo, token, fetchImpl)\n  const candidates = releases\n    .filter(isReleaseCutDraft)\n    .sort((a, b) => new Date(a.created_at ?? 0).getTime() - new Date(b.created_at ?? 0).getTime())\n\n  const published = []\n  const skipped = []\n\n  for (const release of candidates) {\n    const tag = release.tag_name\n    if (!(await Promise.resolve(isDraftBuiltFromCurrentRef({ tag, release })))) {\n      const reason = 'tag is not built from the current release ref'\n      skipped.push({ tag, reason })","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/publish-complete-draft-releases.mjs#L67-L103","documentation":"Thrown by publishCompleteDraftReleases in config/scripts/publish-complete-draft-releases.mjs when the `repo` option is falsy. The function needs the `{owner}/{name}` slug to build every GitHub API URL (list releases, verify assets, PATCH a draft), so an empty repo makes all downstream calls meaningless. The guard at line 84-85 runs before any network call.","triggerScenarios":"Call `publishCompleteDraftReleases({ token })` (no repo), or call it with `repo: ''` / `repo: undefined`. When run via main(), repo defaults to `process.env.GITHUB_REPOSITORY || 'stablyai/orca'`, so the direct-API path (tests, other scripts) is where this typically fires.","commonSituations":"A test or downstream script calls the exported function without forwarding GITHUB_REPOSITORY, or a refactor changes the option name. In the CLI path it only triggers if GITHUB_REPOSITORY is explicitly set to an empty string (overriding the 'stablyai/orca' default).","solutions":["Pass a `{owner}/{name}` repo slug, e.g. `publishCompleteDraftReleases({ repo: 'stablyai/orca', token })`.","In the CLI path, ensure GITHUB_REPOSITORY is set or unset (it defaults to 'stablyai/orca').","Forward the repo from your caller rather than relying on an implicit default."],"exampleFix":"// before\nawait publishCompleteDraftReleases({ token })\n\n// after\nawait publishCompleteDraftReleases({ repo: 'stablyai/orca', token })","handlingStrategy":"validation","validationCode":"if (!repo || !/^.+\\/.+$/.test(repo)) {\n  throw new Error(`publishCompleteDraftReleases needs an {owner}/{name} repo slug, got: ${String(repo)}`)\n}","typeGuard":"function isRepoSlug(value) {\n  return typeof value === 'string' && /^[-.\\w]+\\/.+$/.test(value)\n}","tryCatchPattern":null,"preventionTips":["Always forward GITHUB_REPOSITORY when invoking the script in CI.","Pass an explicit `repo` option when calling the API directly.","Validate the slug shape at the call site before the network call."],"tags":["api","validation","github","release"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}