Skip to content

Commit 499a83f

Browse files
committed
[antispam] experimenting (WIP)
1 parent 2adc270 commit 499a83f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/scripts/antispam.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,16 @@ module.exports = async ({ github, context, core }) => {
8484
})();
8585

8686
const is_author_only_contribution_on_GH = (async () => {
87+
// WARNING: Depending on the time of day, event latency can be anywhere from 30s to 6h. (source: https://octokit.github.io/rest.js/v21/)
8788
const { data: events } = await github.rest.activity.listEventsForAuthenticatedUser({
88-
username: author,
89-
per_page: 1
89+
username: author
90+
// per_page: 1
9091
});
9192

9293
console.log(">>> is_author_only_contribution_on_GH: ", {
9394
username: author,
94-
events_length: events.length === 0
95+
events_length: events.length === 0,
96+
events: events
9597
});
9698

9799
return events.length === 0;
@@ -100,8 +102,8 @@ module.exports = async ({ github, context, core }) => {
100102
console.log(">>> context.payload:", context.payload)
101103

102104
const checks = [
103-
new Check(() => was_author_account_recently_created(), "Account is less than an hour old"),
104-
new Check(() => is_author_only_contribution_on_GH(), "First contribution to any GitHub project"),
105+
new Check(() => was_author_account_recently_created, "Account is less than an hour old"),
106+
new Check(() => is_author_only_contribution_on_GH, "First contribution to any GitHub project"),
105107
new Check(() => user.followers === 0 && user.following === 0, "Author has no relationships"),
106108
new Check(() => user.public_repos === 0 && user.public_gists === 0, "Author has no public reop/gist"),
107109
];

0 commit comments

Comments
 (0)