(url: string)
| 32 | |
| 33 | /** GitHub issue URL → repo + issue number. Throws on anything that isn't an issue URL. */ |
| 34 | export function parseIssueUrl(url: string): { |
| 35 | repo: string |
| 36 | issueNumber: number |
| 37 | } { |
| 38 | const match = url |
| 39 | .trim() |
| 40 | .match( |
| 41 | /^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)(?:[/?#].*)?$/i, |
| 42 | ) |
| 43 | if (!match) { |
| 44 | throw new Error( |
| 45 | 'Enter a GitHub issue URL like https://github.com/owner/repo/issues/123', |
| 46 | ) |
| 47 | } |
| 48 | return { repo: `${match[1]}/${match[2]}`, issueNumber: Number(match[3]) } |
| 49 | } |
| 50 | |
| 51 | const WORKDIR = '/workspace' |
| 52 | const SANDBOX_IMAGE = process.env.SANDBOX_IMAGE ?? 'node:22' |
no outgoing calls
no test coverage detected