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

Function closePullRequest

script/github/close-prs.ts:258–272  ·  view source on GitHub ↗
(pr: CleanupCandidate)

Source from the content-addressed store, hash-verified

256}
257
258async function closePullRequest(pr: CleanupCandidate) {
259 await githubRequest(`/repos/${repo.owner}/${repo.name}/issues/${pr.number}/comments`, {
260 method: "POST",
261 body: JSON.stringify({ body: message }),
262 })
263 await githubRequest(`/repos/${repo.owner}/${repo.name}/pulls/${pr.number}`, {
264 method: "PATCH",
265 body: JSON.stringify({ state: "closed" }),
266 })
267 await githubRequest(`/repos/${repo.owner}/${repo.name}/issues/${pr.number}/labels`, {
268 method: "POST",
269 body: JSON.stringify({ labels: [cleanupLabel] }),
270 })
271 console.log(`Closed #${pr.number} positive=${pr.positiveReactions} ${pr.url}`)
272}
273
274async function ensureCleanupLabel() {
275 const response = await fetch(

Callers 1

mainFunction · 0.85

Calls 2

githubRequestFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected