{"record":{"id":"97e29f6214479875","repo":"tinyhumansai/openhuman","slug":"could-not-infer-github-repo-pass-repo-owner-rep","errorCode":null,"errorMessage":"Could not infer GitHub repo. Pass --repo owner/repo.","messagePattern":"Could not infer GitHub repo\\. Pass --repo owner/repo\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/release/generate-release-notes.mjs","lineNumber":130,"sourceCode":"  return null;\n}\n\nfunction resolveRepo(explicitRepo) {\n  if (explicitRepo) {\n    return explicitRepo;\n  }\n  for (const remote of ['upstream', 'origin']) {\n    try {\n      const url = runGit(['remote', 'get-url', remote], { allowFailure: true });\n      const repo = parseGitHubRepoFromRemote(url);\n      if (repo) {\n        return repo;\n      }\n    } catch {\n      // Try the next remote.\n    }\n  }\n  throw new Error('Could not infer GitHub repo. Pass --repo owner/repo.');\n}\n\nfunction resolveEndRef(to) {\n  if (to !== 'latest-tag') {\n    return to;\n  }\n\n  const tag = runGit(['describe', '--tags', '--abbrev=0']);\n  if (!tag) {\n    throw new Error('Could not resolve latest tag');\n  }\n  return tag;\n}\n\nfunction resolveStartRef(repo, from) {\n  if (from !== 'latest-release') {\n    return from;\n  }","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/scripts/release/generate-release-notes.mjs#L112-L148","documentation":"The release-notes script needs a GitHub owner/repo to call `gh`. Resolution order: explicit --repo, then GITHUB_REPOSITORY, then parsing `git remote get-url upstream` and `origin` for a github.com URL (parseGitHubRepoFromRemote). When every source comes up empty it throws, telling you to pass --repo explicitly.","triggerScenarios":"Running with no --repo and no GITHUB_REPOSITORY in a clone whose remotes are missing (shallow CI checkout), named differently, or hosted outside github.com; remote URLs in an unusual scheme that parseGitHubRepoFromRemote does not recognize.","commonSituations":"actions/checkout with a token-URL origin the parser rejects; running in a container volume copy of the repo with no .git remotes; detached CI runners that only set GITHUB_REPOSITORY for some jobs.","solutions":["Pass the slug explicitly: `--repo tinyhumansai/openhuman`","Or export GITHUB_REPOSITORY=owner/repo (GitHub Actions sets this natively — make sure the step inherits env)","Or ensure an `upstream`/`origin` remote with a github.com URL exists (`git remote add upstream git@github.com:owner/name.git`)"],"exampleFix":"# before\nnode scripts/release/generate-release-notes.mjs --from latest-release --to latest-tag\n# → Error: Could not infer GitHub repo. Pass --repo owner/repo.\n\n# after\nnode scripts/release/generate-release-notes.mjs --repo tinyhumansai/openhuman --from latest-release --to latest-tag","handlingStrategy":"validation","validationCode":"const repo = options.repo\n  || process.env.GITHUB_REPOSITORY\n  || (() => { for (const r of ['upstream', 'origin']) { try {\n      const url = runGit(['remote', 'get-url', r], { allowFailure: true });\n      const parsed = parseGitHubRepoFromRemote(url); if (parsed) return parsed;\n    } catch {} } return null; })();\nif (!repo) { console.error('Pass --repo owner/repo (or set GITHUB_REPOSITORY)'); process.exit(2); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make release automation deterministic: always pass --repo owner/repo explicitly instead of relying on remote inference","In GitHub Actions, propagate the native GITHUB_REPOSITORY env to the step so inference has a guaranteed source"],"tags":["release","git","github","ci","config"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}