Skip to content

Commit d636e23

Browse files
committed
[antispam] experimenting (WIP)
1 parent f544976 commit d636e23

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

.github/workflows/scripts/antispam.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,14 @@ ${reasons}
3030

3131
console.log(">>> DEBUG:\n", commentBody);
3232

33-
// await github.rest.issues.createComment({
34-
// owner,
35-
// repo,
36-
// issue_number: issueNumber,
37-
// body: commentBody
38-
// });
39-
40-
41-
// TODO: if too many checks failed, then consider immediatly closing:
33+
// TODO: if too many or critical checks failed, then consider immediatly closing:
4234

4335
// await github.rest.issues.update({
4436
// owner,
4537
// repo,
4638
// issue_number: issueNumber,
4739
// state: "closed"
4840
// });
49-
5041
}
5142

5243
class Check {
@@ -100,8 +91,8 @@ module.exports = async ({ github, context, core }) => {
10091
})();
10192

10293
const checks = [
103-
new Check({ predicate: was_author_account_recently_created, reason: "Account is less than an hour old" }),
104-
new Check({ predicate: is_author_only_contribution_on_GH, reason: "First contribution to any GitHub project" }),
94+
new Check({ predicate: () => was_author_account_recently_created(), reason: "Account is less than an hour old" }),
95+
new Check({ predicate: () => is_author_only_contribution_on_GH(), reason: "First contribution to any GitHub project" }),
10596
new Check({ predicate: () => user.followers === 0 && user.following === 0, reason: "Author has no relationships" }),
10697
new Check({ predicate: () => user.public_repos === 0 && user.public_gists === 0, reason: "Author has no public reop/gist" }),
10798
];

0 commit comments

Comments
 (0)