Hmbown/CodeWhale · error · Error

Could not inspect GitHub Release

Error message

Could not inspect GitHub Release ${tag}${detail ? `: ${detail}` : ""}

What it means

Thrown by fetchRelease() when the `gh api repos/OWNER/REPO/releases/tags/TAG` call fails for any reason other than a clean HTTP 404 (which is treated as 'release absent'). The gh CLI's stderr is embedded as detail — typical causes are missing/expired GITHUB_TOKEN, network failure, or the repository not existing for the caller. This is a wrapper error around gh CLI failure, not a release-content problem.

Solutions

  1. Read the detail suffix for the underlying gh stderr message
  2. Ensure gh is installed and GH_BIN points at it if non-standard
  3. Check GITHUB_TOKEN/authentication and network access; verify the repo exists and is accessible
  4. If the release is intentionally absent, a 404 is handled and returns null — this error means the failure was something else
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at scripts/release/ensure-release-assets-absent.js:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/04c8cc183218c71c. Report an issue: GitHub.

Appendix: source

Thrown at scripts/release/ensure-release-assets-absent.js:41

  );
}

function fetchRelease(repo, tag, ghBin = process.env.GH_BIN || "gh", exec = execFileSync) {
  validateTarget(repo, tag);
  const endpoint = `repos/${repo}/releases/tags/${encodeURIComponent(tag)}`;
  let output;
  try {
    output = exec(ghBin, ["api", endpoint], {
      encoding: "utf8",
      maxBuffer: 10 * 1024 * 1024,
      stdio: ["ignore", "pipe", "pipe"],
    });
  } catch (error) {
    if (isNotFoundError(error)) {
      return null;
    }
    const detail = String(error && error.stderr ? error.stderr : "").trim();
    throw new Error(
      `Could not inspect GitHub Release ${tag}${detail ? `: ${detail}` : ""}`,
    );
  }

  try {
    return JSON.parse(output);
  } catch (error) {
    throw new Error(`GitHub Release ${tag} returned invalid JSON: ${error.message}`);
  }
}

function assertReleaseAssetsAbsent(release, tag) {
  if (release === null) {
    return;
  }
  if (!release || !Array.isArray(release.assets)) {
    throw new Error(`GitHub Release ${tag} did not provide an asset inventory`);
  }

View on GitHub (pinned to 433685b202)