Hmbown/CodeWhale · error · Error

Invalid release tag

Error message

Invalid release tag: ${tag}

What it means

Validation guard in validateTarget(): the tag argument failed the ^v[0-9]+\.[0-9]+\.[0-9]+$ pattern, so it is not a semantic version tag of the form vX.Y.Z. It fires before any network call; at fault is a tag like '1.2.3' (missing v prefix), 'v1.2', or a non-release ref name.

Solutions

  1. Pass the tag in strict vX.Y.Z form, e.g. v1.4.2
  2. If you have a bare version string, prefix it with 'v' before invoking the script
  3. Confirm the workflow/CI input actually contains the release tag, not a branch or SHA
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/release/ensure-release-assets-absent.js:14 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/969d4c369ea167c4. Report an issue: GitHub.

Appendix: source

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

#!/usr/bin/env node

const { execFileSync } = require("node:child_process");

function usage() {
  return "Usage: node scripts/release/ensure-release-assets-absent.js OWNER/REPO vX.Y.Z";
}

function validateTarget(repo, tag) {
  if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(repo)) {
    throw new Error(`Invalid GitHub repository: ${repo}`);
  }
  if (!/^v[0-9]+\.[0-9]+\.[0-9]+$/.test(tag)) {
    throw new Error(`Invalid release tag: ${tag}`);
  }
}

function isNotFoundError(error) {
  return (
    error &&
    error.status !== 0 &&
    /\bHTTP 404\b/.test(String(error.stderr || ""))
  );
}

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",

View on GitHub (pinned to 433685b202)