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.
This commit is contained in:
evanpelle
2026-05-30 09:19:47 -07:00
parent f366f762cc
commit 885e31460c
2 changed files with 18 additions and 0 deletions
+5
View File
@@ -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.
+13
View File
@@ -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;