tinyhumansai/openhuman · error · Error

Could not infer GitHub repo. Pass --repo owner/repo.

Error message

Could not infer GitHub repo. Pass --repo owner/repo.

What it means

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.

Source

Thrown at scripts/release/generate-release-notes.mjs:130

  return null;
}

function resolveRepo(explicitRepo) {
  if (explicitRepo) {
    return explicitRepo;
  }
  for (const remote of ['upstream', 'origin']) {
    try {
      const url = runGit(['remote', 'get-url', remote], { allowFailure: true });
      const repo = parseGitHubRepoFromRemote(url);
      if (repo) {
        return repo;
      }
    } catch {
      // Try the next remote.
    }
  }
  throw new Error('Could not infer GitHub repo. Pass --repo owner/repo.');
}

function resolveEndRef(to) {
  if (to !== 'latest-tag') {
    return to;
  }

  const tag = runGit(['describe', '--tags', '--abbrev=0']);
  if (!tag) {
    throw new Error('Could not resolve latest tag');
  }
  return tag;
}

function resolveStartRef(repo, from) {
  if (from !== 'latest-release') {
    return from;
  }

View on GitHub (pinned to a221052e0d)

Solutions

  1. Pass the slug explicitly: `--repo tinyhumansai/openhuman`
  2. Or export GITHUB_REPOSITORY=owner/repo (GitHub Actions sets this natively — make sure the step inherits env)
  3. Or ensure an `upstream`/`origin` remote with a github.com URL exists (`git remote add upstream git@github.com:owner/name.git`)

Example fix

# before
node scripts/release/generate-release-notes.mjs --from latest-release --to latest-tag
# → Error: Could not infer GitHub repo. Pass --repo owner/repo.

# after
node scripts/release/generate-release-notes.mjs --repo tinyhumansai/openhuman --from latest-release --to latest-tag
Defensive patterns

Strategy: validation

Validate before calling

const repo = options.repo
  || process.env.GITHUB_REPOSITORY
  || (() => { for (const r of ['upstream', 'origin']) { try {
      const url = runGit(['remote', 'get-url', r], { allowFailure: true });
      const parsed = parseGitHubRepoFromRemote(url); if (parsed) return parsed;
    } catch {} } return null; })();
if (!repo) { console.error('Pass --repo owner/repo (or set GITHUB_REPOSITORY)'); process.exit(2); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/97e29f6214479875. Report an issue: GitHub.