Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
TypeScript
fix: improve duplicate issue number extraction in auto-close script
Boris Cherny370a97d9397e
diff --git a/scripts/auto-close-duplicates.ts b/scripts/auto-close-duplicates.tsindex 0cee40a0..2ad3bd31 100644--- a/scripts/auto-close-duplicates.ts+++ b/scripts/auto-close-duplicates.ts@@ -47,8 +47,19 @@ async function githubRequest<T>(endpoint: string, token: string, method: string}function extractDuplicateIssueNumber(commentBody: string): number | null {- const match = commentBody.match(/#(\d+)/);- return match ? parseInt(match[1], 10) : null;+ // Try to match #123 format first+ let match = commentBody.match(/#(\d+)/);+ if (match) {+ return parseInt(match[1], 10);+ }++ // Try to match GitHub issue URL format: https://github.com/owner/repo/issues/123+ match = commentBody.match(/github\.com\/[^\/]+\/[^\/]+\/issues\/(\d+)/);+ if (match) {+ return parseInt(match[1], 10);+ }++ return null;}