From 0e9c2c22792b7c55dddb3512acf3f206b75c0869 Mon Sep 17 00:00:00 2001 From: Jules YZERD Date: Mon, 15 Jun 2026 23:49:13 +0200 Subject: [PATCH] fix(scripts): add duplicate label additively, don't replace existing labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PATCH to /issues/{number} with `labels: ['duplicate']` is a full replacement — GitHub treats this field as the new complete label set, erasing platform, area, priority, and lifecycle labels set by the triage bot. Split the operation: close the issue with PATCH (no labels field), then POST to /issues/{number}/labels to add 'duplicate' additively. Fixes #60656 Co-Authored-By: Claude Sonnet 4.6 --- scripts/auto-close-duplicates.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/auto-close-duplicates.ts b/scripts/auto-close-duplicates.ts index 2ad3bd3112..32e77db97c 100644 --- a/scripts/auto-close-duplicates.ts +++ b/scripts/auto-close-duplicates.ts @@ -77,10 +77,18 @@ async function closeIssueAsDuplicate( { state: 'closed', state_reason: 'duplicate', - labels: ['duplicate'] } ); + // Add the duplicate label additively — PATCH with `labels` replaces the + // entire label set, which would erase platform/area/priority metadata. + await githubRequest( + `/repos/${owner}/${repo}/issues/${issueNumber}/labels`, + token, + 'POST', + { labels: ['duplicate'] } + ); + await githubRequest( `/repos/${owner}/${repo}/issues/${issueNumber}/comments`, token,