From 1a7f50661a43e0bcb32f5075131bf168747024d1 Mon Sep 17 00:00:00 2001 From: Sandy Tao Date: Wed, 11 Mar 2026 15:28:20 -0700 Subject: [PATCH] fix: remove status/need-triage from maintainer-only issues (#22044) Co-authored-by: Bryan Morgan --- .github/scripts/sync-maintainer-labels.cjs | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/scripts/sync-maintainer-labels.cjs b/.github/scripts/sync-maintainer-labels.cjs index 41a75e99fa..1ee4a3618a 100644 --- a/.github/scripts/sync-maintainer-labels.cjs +++ b/.github/scripts/sync-maintainer-labels.cjs @@ -347,6 +347,36 @@ async function run() { }); } } + + // Remove status/need-triage from maintainer-only issues since they + // don't need community triage. We always attempt removal rather than + // checking the (potentially stale) label snapshot, because the + // issue-opened-labeler workflow runs concurrently and may add the + // label after our snapshot was taken. + if (isDryRun) { + console.log( + `[DRY RUN] Would remove status/need-triage from ${issueKey}`, + ); + } else { + try { + await octokit.rest.issues.removeLabel({ + owner: issueInfo.owner, + repo: issueInfo.repo, + issue_number: issueInfo.number, + name: 'status/need-triage', + }); + console.log(`Removed status/need-triage from ${issueKey}`); + } catch (removeError) { + // 404 means the label wasn't present — that's fine. + if (removeError.status === 404) { + console.log( + `status/need-triage not present on ${issueKey}, skipping.`, + ); + } else { + throw removeError; + } + } + } } catch (error) { console.error(`Error processing label for ${issueKey}: ${error.message}`); }