{"record":{"id":"72c6ace62d76e6f7","repo":"stablyai/orca","slug":"tag-is-required","errorCode":null,"errorMessage":"tag is required","messagePattern":"tag is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/create-draft-release.mjs","lineNumber":125,"sourceCode":"  if (availableLength <= 0) {\n    throw new Error('Release truncation notice is longer than the maximum release body length')\n  }\n\n  return `${body.slice(0, availableLength).trimEnd()}${TRUNCATION_NOTICE}`\n}\n\nexport async function createDraftRelease({\n  repo,\n  tag,\n  token,\n  fetchImpl = fetch,\n  log = console.log\n}) {\n  if (!repo) {\n    throw new Error('repo is required')\n  }\n  if (!tag) {\n    throw new Error('tag is required')\n  }\n  if (!token) {\n    throw new Error('token is required')\n  }\n\n  const previousTag = latestPreviousPublishedDesktopReleaseTag(\n    await fetchRepoReleases(repo, token, fetchImpl),\n    tag\n  )\n  const generateNotesBody = {\n    tag_name: tag,\n    target_commitish: tag,\n    ...(previousTag ? { previous_tag_name: previousTag } : {})\n  }\n\n  // Why: GitHub's generate-notes baseline ignores draft releases, so pass the\n  // previous public changelog boundary explicitly.\n  const releaseNotes = await githubJson(","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/create-draft-release.mjs#L107-L143","documentation":"Thrown by createDraftRelease when the tag parameter is falsy. tag is required for tag_name, target_commitish, and release naming (create-draft-release.mjs:124-126). In main(), tag comes from process.argv[2], so this fires when the script is run without a positional tag argument.","triggerScenarios":"Running `node create-draft-release.mjs` with no argument; calling createDraftRelease without tag; passing an empty string as the tag positional.","commonSituations":"A release workflow step that forgot to pass $TAG; a CI trigger that did not set the tag variable; invoking the script during local testing without arguments.","solutions":["Pass a version tag as the first positional argument: node config/scripts/create-draft-release.mjs v1.4.160.","In programmatic callers, always supply tag in the params object.","Validate tag is non-empty and matches the desktop release pattern (vX.Y.Z or vX.Y.Z-rc.N) before calling."],"exampleFix":"// before (CLI)\nnode config/scripts/create-draft-release.mjs\n// after\nnode config/scripts/create-draft-release.mjs v1.4.160","handlingStrategy":"validation","validationCode":"const tag = process.argv[2]\nif (!tag || !/^v\\d+\\.\\d+\\.\\d+(?:-rc\\.\\d+)?$/.test(tag)) {\n  throw new Error('Provide a tag like v1.4.160 as the first argument')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass the tag as the first positional CLI argument or a named param in programmatic calls.","Validate the tag matches the desktop release pattern before invoking."],"tags":["argument-validation","release","cli"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}