{"record":{"id":"39d57dff81ef4ce2","repo":"mastra-ai/mastra","slug":"only-github-com-plugin-urls-are-supported","errorCode":null,"errorMessage":"Only github.com plugin URLs are supported","messagePattern":"Only github\\.com plugin URLs are supported","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mastracode/sdk/src/plugins/install.ts","lineNumber":238,"sourceCode":"  } catch {\n    throw new Error('GitHub CLI is not authenticated. Run gh auth login, then install the plugin again.');\n  }\n}\n\nfunction parseGithubUrl(specifier: string): { owner: string; repo: string; repoSpec: string; ref?: string } {\n  const [urlPart, ref] = specifier.split('#', 2);\n  if (!urlPart) {\n    throw new Error(`Invalid GitHub URL: ${specifier}`);\n  }\n  let url: URL;\n  try {\n    url = new URL(urlPart);\n  } catch {\n    throw new Error(`Invalid GitHub URL: ${specifier}`);\n  }\n\n  if (url.hostname !== 'github.com') {\n    throw new Error('Only github.com plugin URLs are supported');\n  }\n\n  const [owner, rawRepo, ...rest] = url.pathname.split('/').filter(Boolean);\n  if (!owner || !rawRepo || rest.length > 0) {\n    throw new Error('GitHub plugin URL must be in the form https://github.com/owner/repo');\n  }\n\n  const repo = rawRepo.replace(/\\.git$/, '');\n  if (!/^[A-Za-z0-9_.-]+$/.test(owner) || !/^[A-Za-z0-9_.-]+$/.test(repo)) {\n    throw new Error('GitHub owner and repo may only contain letters, numbers, dots, underscores, and dashes');\n  }\n\n  return {\n    owner,\n    repo,\n    repoSpec: `${owner}/${repo}`,\n    ...(ref ? { ref } : {}),\n  };","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/mastracode/sdk/src/plugins/install.ts#L220-L256","documentation":"The URL parsed successfully but its hostname is not exactly 'github.com'. The V1 plugin installer only supports public github.com repositories (it shells out to the gh CLI against github.com), so any other host is rejected outright.","triggerScenarios":"Installing from 'https://gitlab.com/owner/repo', a GitHub Enterprise host like 'https://github.mycompany.com/owner/repo', or a typo'd host such as 'https://gihub.com/owner/repo'.","commonSituations":"Corporate environments that mirror repos on GHES or GitLab; using a redirect/shortener host; typos in the hostname.","solutions":["Use a repository hosted on github.com; mirror the plugin repo there if it currently lives on another host.","Fix hostname typos so it reads exactly 'github.com' (subdomains like 'www.github.com' also fail).","If the code must target GitHub Enterprise, fork/extend parseGithubUrl rather than passing the GHES URL."],"exampleFix":"// before\nawait installPlugin('https://github.mycompany.com/acme/widgets'); // GHES host\n// after\nawait installPlugin('https://github.com/acme/widgets');","handlingStrategy":"validation","validationCode":"function isGithubComUrl(specifier: string): boolean {\n  try {\n    return new URL(specifier.split('#')[0]).hostname === 'github.com';\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await installPlugin(specifier);\n} catch (error) {\n  if (error instanceof Error && error.message === 'Only github.com plugin URLs are supported') {\n    throw new Error(`Plugin installs require github.com; \"${specifier}\" points elsewhere (GHES/GitLab unsupported)`);\n  }\n  throw error;\n}","preventionTips":["Only reference repositories hosted on github.com for plugin installs.","Mirror GHES/GitLab repos to github.com before installing.","Validate hostname === 'github.com' in config loaders that accept plugin URLs."],"tags":["plugin-install","url-validation","github","unsupported-host"],"backgroundTag":"unsupported-url-host","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}