Skip to content

Commit 0e58a31

Browse files
committed
[antispam] experimenting (WIP)
1 parent 5ed9f0b commit 0e58a31

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/scripts/antispam.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ module.exports = async ({ github, context, core }) => {
5959
const username = context.actor;
6060
const { data: user } = await github.rest.users.getByUsername({ username: username });
6161

62-
console.log(">>> DEBUG:", user)
63-
6462
const isAuthorOnlyContributionOnGH = await (async () => {
6563
// WARNING: Depending on the time of day, event latency can be anywhere from 30s to 6h. (source: https://octokit.github.io/rest.js/v21/)
6664
const { data: events } = await github.rest.activity.listEventsForAuthenticatedUser({
@@ -124,8 +122,19 @@ module.exports = async ({ github, context, core }) => {
124122
const failed_checks = checks.filter(check => ! check.pass());
125123

126124
const threshold = 0;
127-
if (failed_checks.length <= threshold)
125+
if (failed_checks.length <= threshold){
126+
console.info("Not suspicious");
128127
return;
128+
}
129129

130130
when_suspicious({ github, context, failed_checks});
131+
132+
// we might also create a (pre-)report for spam using the following informations:
133+
// user.email
134+
// user.login
135+
// user.name
136+
// user.location
137+
// user.blog
138+
// user.location
139+
// user.email
131140
};

0 commit comments

Comments
 (0)