MCPcopy Create free account
hub / github.com/anthropics/claude-code / closeIssueAsDuplicate

Function closeIssueAsDuplicate

scripts/auto-close-duplicates.ts:66–97  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  issueNumber: number,
  duplicateOfNumber: number,
  token: string
)

Source from the content-addressed store, hash-verified

64
65
66async function closeIssueAsDuplicate(
67 owner: string,
68 repo: string,
69 issueNumber: number,
70 duplicateOfNumber: number,
71 token: string
72): Promise<void> {
73 await githubRequest(
74 `/repos/${owner}/${repo}/issues/${issueNumber}`,
75 token,
76 'PATCH',
77 {
78 state: 'closed',
79 state_reason: 'duplicate',
80 labels: ['duplicate']
81 }
82 );
83
84 await githubRequest(
85 `/repos/${owner}/${repo}/issues/${issueNumber}/comments`,
86 token,
87 'POST',
88 {
89 body: `This issue has been automatically closed as a duplicate of #${duplicateOfNumber}.
90
91If this is incorrect, please re-open this issue or create a new one.
92
93🤖 Generated with [Claude Code](https://claude.ai/code)`
94 }
95 );
96
97}
98
99async function autoCloseDuplicates(): Promise<void> {
100 console.log("[DEBUG] Starting auto-close duplicates script");

Callers 1

autoCloseDuplicatesFunction · 0.85

Calls 1

githubRequestFunction · 0.70

Tested by

no test coverage detected