{"record":{"id":"277a1b38642fe46e","repo":"stablyai/orca","slug":"name-is-required","errorCode":null,"errorMessage":"${name} is required.","messagePattern":"(.+?) is required\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-release-mac-build-workflow.mjs","lineNumber":214,"sourceCode":"  return JSON.stringify(data)\n}\n\nfunction readPositiveInteger(rawValue, defaultValue) {\n  if (rawValue == null || rawValue === '') {\n    return defaultValue\n  }\n\n  const value = Number(rawValue)\n  if (!Number.isInteger(value) || value <= 0) {\n    throw new Error(`Expected a positive integer, got \"${rawValue}\".`)\n  }\n\n  return value\n}\n\nfunction requiredEnv(value, name) {\n  if (value == null || value === '') {\n    throw new Error(`${name} is required.`)\n  }\n\n  return value\n}\n\nfunction sleepMilliseconds(milliseconds) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, milliseconds)\n  })\n}\n\nif (import.meta.url === `file://${process.argv[1]}`) {\n  runReleaseMacBuildWorkflow(readReleaseMacBuildWorkflowOptions()).catch((error) => {\n    console.error(error)\n    process.exitCode = 1\n  })\n}\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-release-mac-build-workflow.mjs#L196-L232","documentation":"Thrown by requiredEnv() in the macOS release build workflow harness when a required environment variable is null, undefined, or the empty string. The workflow refuses to proceed because the GitHub Actions release job cannot be dispatched without all of its identifying inputs (ref, run id, repository, tag, token). The message interpolates the missing variable's name so the operator can see exactly which input is absent.","triggerScenarios":"Invoking run-release-mac-build-workflow.mjs (typically via pnpm run release:mac-build or a workflow_dispatch) where one of RELEASE_MAC_BUILD_REF, RELEASE_MAC_BUILD_RUN_ID, GITHUB_REPOSITORY, RELEASE_MAC_BUILD_TAG, or GITHUB_TOKEN/GH_TOKEN is unset or empty in process.env.","commonSituations":"Running the release harness locally without sourcing the CI env file; a GitHub Actions step that forgot to pass env: secrets.GITHUB_TOKEN; renaming a repository variable so RELEASE_MAC_BUILD_TAG no longer matches; a forked repo where the release workflow was copied but env inputs were not wired.","solutions":["Set every required variable before invoking the harness, e.g. export RELEASE_MAC_BUILD_REF=$GIT_REF RELEASE_MAC_BUILD_RUN_ID=$RUN_ID GITHUB_REPOSITORY=owner/repo RELEASE_MAC_BUILD_TAG=$TAG GITHUB_TOKEN=$TOKEN.","If running in GitHub Actions, add the missing key under the step's env: map (secrets.GITHUB_TOKEN for the token, github.* context values for ref/repo).","Confirm the variable name spelling matches the requiredEnv() calls at run-release-mac-build-workflow.mjs:10-21 — copy-paste the exact identifier."],"exampleFix":"// before\npnpm run release:mac-build\n// after\nRELEASE_MAC_BUILD_REF=v1.2.3 RELEASE_MAC_BUILD_RUN_ID=42 GITHUB_REPOSITORY=owner/repo RELEASE_MAC_BUILD_TAG=v1.2.3 GITHUB_TOKEN=$TOKEN pnpm run release:mac-build","handlingStrategy":"validation","validationCode":"// before invoking the workflow, assert all required env vars\nconst REQUIRED = ['RELEASE_MAC_BUILD_REF','RELEASE_MAC_BUILD_RUN_ID','GITHUB_REPOSITORY','RELEASE_MAC_BUILD_TAG','GITHUB_TOKEN']\nconst missing = REQUIRED.filter((k) => !process.env[k])\nif (missing.length) {\n  console.error(`Missing required env: ${missing.join(', ')}`)\n  process.exit(1)\n}","typeGuard":"// narrows a possibly-undefined env value to a non-empty string\nfunction isNonEmptyEnv(value: string | undefined): value is string {\n  return typeof value === 'string' && value.length > 0\n}","tryCatchPattern":null,"preventionTips":["Keep the release env-var list in a single shared constant referenced by both the workflow and the script.","Surface required inputs in the GitHub Actions workflow_dispatch inputs so they are visible and validated upstream.","Add a pre-flight `node -e` check in CI that prints which required vars are set before invoking the harness."],"tags":["ci","release","env","github-actions"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}