oven-sh/bun · error
Failed to get release info for ${tag}: ${error}
Error message
Failed to get release info for ${tag}: ${error} What it means
Thrown by getReleaseInfo() in scripts/github-metrics.ts when the underlying `gh release view <tag> --json publishedAt,tagName` shell call fails. The script wraps GitHub's official CLI, so any CLI-level failure is re-thrown as this Error with the original gh message appended after the tag.
Source
Thrown at scripts/github-metrics.ts:35
content: string;
}
interface Comment {
id: number;
}
/**
* Get release information for a given tag
*/
async function getReleaseInfo(tag: string): Promise<ReleaseInfo> {
try {
const result = await $`gh release view ${tag} --json publishedAt,tagName`.json();
return {
publishedAt: result.publishedAt,
tag: result.tagName,
};
} catch (error) {
throw new Error(`Failed to get release info for ${tag}: ${error}`);
}
}
/**
* Count issues closed as completed since a given date
*/
async function countCompletedIssues(sinceDate: string): Promise<{ count: number; issues: number[] }> {
try {
const result =
(await $`gh issue list --state closed --search "closed:>=${sinceDate} reason:completed" --limit 1000 --json number,closedAt,stateReason`.json()) as Issue[];
const completedIssues = result.filter(issue => issue.stateReason === "COMPLETED");
return {
count: completedIssues.length,
issues: completedIssues.map(issue => issue.number),
};
} catch (error) {View on GitHub (pinned to 8c5296ac45)
Solutions
- Confirm the release exists: run `gh release view <tag> --repo oven-sh/bun` manually
- Check auth: `gh auth status`; in CI export GH_TOKEN or GITHUB_TOKEN
- If the tag has no Release, create one (`gh release create <tag>`) or point the script at an existing release tag
- Re-run after fixing network/rate-limit (secondary rate limits resolve in ~1h)
Example fix
// before
const info = await getReleaseInfo(tag);
// after
const check = Bun.spawnSync(['gh', 'release', 'view', tag, '--repo', 'oven-sh/bun']);
if (check.exitCode !== 0) {
console.error(`No GitHub release for ${tag}; skipping metrics`);
process.exit(1);
}
const info = await getReleaseInfo(tag); Defensive patterns
Strategy: validation
Validate before calling
// Verify gh is usable and the release exists before calling getReleaseInfo
await $`gh auth status`.quiet();
const releases = await $`gh release list --repo oven-sh/bun --limit 100 --json tagName`.json();
const tags = new Set(releases.map(r => r.tagName));
if (!tags.has(tag)) {
throw new Error(`tag ${tag} has no GitHub release; create one first`);
} Try / catch
try {
const info = await getReleaseInfo(tag);
} catch (error) {
if (/not found/i.test(String(error))) {
// permanent: tag has no release — skip or create it
} else {
// transient: auth/network/rate-limit — fix env and retry
}
} Prevention
- Always export GH_TOKEN/GITHUB_TOKEN in CI steps that shell out to gh
- Publish the GitHub Release before running the metrics script
- Run `gh auth status` as a first CI step to fail fast on auth
When it happens
Trigger: Calling getReleaseInfo(tag) with a tag that has no GitHub Release object; gh not installed or `gh auth status` failing (no GH_TOKEN/GITHUB_TOKEN in CI); API rate limiting or network failure while gh talks to api.github.com.
Common situations: CI job where the token env var isn't exported to the gh process; a git tag exists but no GitHub Release was published for it; running the metrics script on a laptop that never ran `gh auth login`.
Related errors
- Failed to count completed issues: ${error}
- [azure] Failed to get public IP for ${vmName}
- github ${path}: ${res.status}
- ${res.status} ${job.raw_log_url}
- Failed to download Packer: ${response.status}
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/cfe0dc776bef797a.
Report an issue: GitHub.