MCPcopy Index your code
hub / github.com/anomalyco/opencode / requireRepo

Function requireRepo

script/github/close-prs.ts:338–343  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

336}
337
338function requireRepo(value: string | undefined) {
339 if (!value) throw new Error("repo is required")
340 const [owner, name] = value.split("/")
341 if (!owner || !name) throw new Error(`Invalid repo ${value}; expected owner/name`)
342 return { owner, name }
343}
344
345async function requireToken() {
346 const envToken = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN

Callers 1

close-prs.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected