Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/tools/gh-issue-close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IssueView {
number: number;
title: string;
state: string;
closedByPullRequestsUrls: string[];
closedByPullRequestsReferences: Array<{ number: number; url: string }>;
}

// ────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -63,7 +63,7 @@ export const ghIssueCloseTool = tool({
'--repo',
resolvedRepo,
'--json',
'number,title,state,closedByPullRequestsUrls',
'number,title,state,closedByPullRequestsReferences',
],
cwd
);
Expand All @@ -78,16 +78,16 @@ export const ghIssueCloseTool = tool({
}

// ── Step 2: Zombie detection ──
const urls = issueView.closedByPullRequestsUrls || [];
const isZombie = urls.length > 0;
const refs = issueView.closedByPullRequestsReferences || [];
const isZombie = refs.length > 0;

let outputLines: string[] = [];

if (isZombie) {
outputLines.push('⚠️ ZOMBIE ISSUE DETECTED');
outputLines.push(` Issue #${issueNum} "${issueView.title}" was closed by merged PR(s):`);
for (const url of urls) {
outputLines.push(` • ${url}`);
for (const ref of refs) {
outputLines.push(` • ${ref.url} (PR #${ref.number})`);
}
outputLines.push(' The associated PR is merged but the issue remained open.');
outputLines.push('');
Expand Down
Loading