Skip to content

Commit f51982e

Browse files
authored
Merge pull request #149 from firebase/rpf-lock-spam-issues
feat: lock spam issues after they're closed
2 parents 1859533 + 3ef3e26 commit f51982e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

functions/src/github.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export class GitHubClient {
136136
repo: name,
137137
issue_number,
138138
state: "closed",
139+
state_reason: "not_planned",
139140
title: "Spam",
140141
body: "This issue was filtered as spam."
141142
});

functions/src/issues.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,18 @@ export class IssueHandler {
275275
});
276276

277277
if (isSpam) {
278-
// Discard other actions and wipe the issue.
278+
// Discard other actions, wipe and lock the issue, and block
279+
// the offending user.
279280
const reason = `Issue is believed to be spam: ${issue.title}`
280281
return [
281282
new types.GitHubSpamAction(
282283
org, name, issue.number, reason
283284
),
284285
new types.GitHubBlockAction(
285286
org, issue.user.login
287+
),
288+
new types.GitHubLockAction(
289+
org, name, issue.number
286290
)
287291
];
288292
}

0 commit comments

Comments
 (0)