From 885e31460cb5c2c343597f9834239000fd5e33f2 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sat, 30 May 2026 09:19:47 -0700 Subject: [PATCH] issue-lifecycle: greet new unmilestoned issues with a comment When an issue is opened without a milestone, post a friendly comment alongside the not-approved label so the reporter knows it's queued for triage. Scoped to the opened event only to avoid spamming old issues on cron reconciliation. --- scripts/issue-lifecycle/config.ts | 5 +++++ scripts/issue-lifecycle/events.ts | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/scripts/issue-lifecycle/config.ts b/scripts/issue-lifecycle/config.ts index 6a0c00684..8e77c3efa 100644 --- a/scripts/issue-lifecycle/config.ts +++ b/scripts/issue-lifecycle/config.ts @@ -51,6 +51,11 @@ This isn't a judgment of the issue's merit — just routine triage. @${author}, — *Automated.*`, + NEW_ISSUE_NOT_APPROVED: (author: string): string => + `Hi @${author}, thanks for opening this issue. It hasn't been approved by a maintainer yet — we'll get back to you shortly to either milestone it (approval) or close it. + +— *Automated. See [CONTRIBUTING.md](https://github.com/${REPO.owner}/${REPO.repo}/blob/main/CONTRIBUTING.md).*`, + UNASSIGNED_NO_MILESTONE: (assignees: string[]): string => `${assignees.map((u) => "@" + u).join(", ")} — you've been unassigned from this issue automatically because it doesn't have a milestone set. diff --git a/scripts/issue-lifecycle/events.ts b/scripts/issue-lifecycle/events.ts index 2ec75c5cc..c05b29d9c 100644 --- a/scripts/issue-lifecycle/events.ts +++ b/scripts/issue-lifecycle/events.ts @@ -1,4 +1,5 @@ import type { Octokit } from "@octokit/rest"; +import { COMMENTS } from "./config"; import { type Action, applyActions, describeAction, getIssue } from "./github"; import { syncApprovalLabel } from "./rules/approval-label-sync"; import { enforceAssignmentInvariant } from "./rules/assignment-invariant"; @@ -55,6 +56,18 @@ export async function runEvent( }); } + if (eventName === "opened" && issue.milestone === null) { + buckets.push({ + rule: "new-issue-greeting", + actions: [ + { + type: "comment", + body: COMMENTS.NEW_ISSUE_NOT_APPROVED(issue.user?.login ?? "there"), + }, + ], + }); + } + let acted = false; for (const { rule, actions } of buckets) { if (actions.length === 0) continue;