From 29f211e51c411fc616c7d45c38f05abefa9ef33b Mon Sep 17 00:00:00 2001 From: Ashley Mensah Date: Tue, 28 Apr 2026 16:08:16 +0200 Subject: [PATCH] fix(ci): guard all decisions behind dry-run check Move the dry-run check to the top of the loop so it applies to all decision types, not just AUTO_CLOSE. In dry-run mode the workflow now only logs what it would do without touching any issues. --- .../scripts/apply-decisions.mjs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/issue-resolution/scripts/apply-decisions.mjs b/.github/issue-resolution/scripts/apply-decisions.mjs index 1500473f5..15b0ff80d 100644 --- a/.github/issue-resolution/scripts/apply-decisions.mjs +++ b/.github/issue-resolution/scripts/apply-decisions.mjs @@ -106,19 +106,12 @@ async function setTextField(itemId, fieldId, value) { for (const d of decisions) { const [owner, repo] = d.repository.split("/"); - if (d.final_decision === "AUTO_CLOSE") { - if (dryRun) { - await addLabel(owner, repo, d.issue_number, ["resolution-candidate"]); - const issueNodeId = await getIssueNodeId(owner, repo, d.issue_number); - const itemId = await addToProject(issueNodeId); - if (itemId) { - await setTextField(itemId, process.env.PROJECT_REASON_FIELD_ID, `DRY_RUN:${d.model.reason_code}`); - await setTextField(itemId, process.env.PROJECT_CONFIDENCE_FIELD_ID, String(d.model.confidence)); - } - console.log(`[DRY RUN] Would auto-close #${d.issue_number}`); - continue; - } + if (dryRun) { + console.log(`[DRY RUN] #${d.issue_number} → ${d.final_decision} (confidence: ${d.model.confidence}, reason: ${d.model.reason_code})`); + continue; + } + if (d.final_decision === "AUTO_CLOSE") { await addLabel(owner, repo, d.issue_number, ["auto-closed-resolved"]); await addComment(owner, repo, d.issue_number, d.model.close_comment); await closeIssue(owner, repo, d.issue_number);