mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 08:20:50 +00:00
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:
@@ -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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user