{"record":{"id":"d9f54680520efc08","repo":"nodejs/node","slug":"this-constructor-providerentity-must-be-specifi","errorCode":null,"errorMessage":"${this.constructor.providerEntity} must be specified in the format owner/repository","messagePattern":"(.+?) must be specified in the format owner/repository","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"deps/npm/lib/commands/trust/github.js","lineNumber":60,"sourceCode":"    trustDefinitions['allow-publish'],\n    trustDefinitions['allow-stage-publish'],\n    // globals are alphabetical\n    globalDefinitions['dry-run'],\n    globalDefinitions.json,\n    globalDefinitions.registry,\n    globalDefinitions.yes,\n  ]\n\n  getEntityUrl ({ providerHostname, file, entity }) {\n    if (file) {\n      return new URL(`${entity}/blob/HEAD/.github/workflows/${file}`, providerHostname).toString()\n    }\n    return new URL(entity, providerHostname).toString()\n  }\n\n  validateEntity (entity) {\n    if (entity.split('/').length !== 2) {\n      throw new Error(`${this.constructor.providerEntity} must be specified in the format owner/repository`)\n    }\n  }\n\n  validateFile (file) {\n    if (file !== path.basename(file)) {\n      throw new Error('GitHub Actions workflow must be just a file not a path')\n    }\n  }\n\n  static optionsToBody (options) {\n    const { file, repository, environment } = options\n    const trustConfig = {\n      type: 'github',\n      claims: {\n        repository,\n        workflow_ref: {\n          file,\n        },","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/npm/lib/commands/trust/github.js#L42-L78","documentation":"Thrown by the GitHub trust provider's `validateEntity` when the entity string, split on `/`, does not have exactly two segments. The required shape is `owner/repository`, matching a GitHub repository coordinate.","triggerScenarios":"`entity.split('/').length !== 2` — e.g. passing a full URL, a scoped path, a single segment, or extra slashes.","commonSituations":"Passing `https://github.com/owner/repo`, `owner/repo/extra`, `owner` alone, or `@scope/pkg` style values.","solutions":["Pass just `owner/repository` (e.g. `npm/cli`).","Strip scheme, host, `.git`, and any trailing path/query before passing.","If you have a full URL, extract the path segments: `new URL(url).pathname.slice(1).replace(/\\.git$/, '')`."],"exampleFix":"// before\n--repository https://github.com/npm/cli\n// after\n--repository npm/cli","handlingStrategy":"validation","validationCode":"function normalizeEntity(entity) {\n  try {\n    const u = new URL(entity)\n    entity = u.pathname.slice(1)\n  } catch { /* not a URL */ }\n  const parts = entity.replace(/\\.git$/, '').split('/').filter(Boolean)\n  if (parts.length !== 2) {\n    throw new Error(`GitHub entity must be owner/repository, got \"${entity}\"`)\n  }\n  return parts.join('/')\n}","typeGuard":"function isOwnerRepo(entity) {\n  return /^[^/\\s]+\\/[^/\\s]+$/.test(String(entity).replace(/\\.git$/, ''))\n}","tryCatchPattern":null,"preventionTips":["Always pass GitHub entities as owner/repo, never full URLs.","Strip .git suffix and any host prefix before invoking the trust command.","Validate with the type guard above in CI templates."],"tags":["trust","github","entity","argument-validation","oidc"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}