MCPcopy Create free account
hub / github.com/SIMARSINGHRAYAT/Gitzo / closeIssue

Function closeIssue

src/utils/github.ts:126–143  ·  view source on GitHub ↗
(
  token: string,
  owner: string,
  repo: string,
  issueNumber: number
)

Source from the content-addressed store, hash-verified

124}
125
126export async function closeIssue(
127 token: string,
128 owner: string,
129 repo: string,
130 issueNumber: number
131) {
132 const res = await ghFetch(`/repos/${owner}/${repo}/issues/${issueNumber}`, token, {
133 method: 'PATCH',
134 body: JSON.stringify({ state: 'closed' }),
135 headers: { 'Content-Type': 'application/json' },
136 });
137
138 if (!res.ok) {
139 const err = await res.json().catch(() => ({ message: res.statusText }));
140 throw new Error(`Failed to close issue: ${err.message || `HTTP ${res.status}`}`);
141 }
142 return res.json();
143}
144
145// ── PR / Branch / Commit APIs ──
146

Callers 1

Calls 1

ghFetchFunction · 0.85

Tested by

no test coverage detected