Skip to content

Instantly share code, notes, and snippets.

@saibotsivad
Created October 1, 2020 17:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saibotsivad/aaccb60a9bcd69336f9b6d7cc8fed627 to your computer and use it in GitHub Desktop.
Save saibotsivad/aaccb60a9bcd69336f9b6d7cc8fed627 to your computer and use it in GitHub Desktop.
Hacktoberfest Burnout Bot

Problem

The "HacktoberFest" created by DigitalOcean is resulting in an enormous number of spammy pull requests. Open source maintainers are already taxed for time, and the additional workload of filtering out these spam requests will add to their workload.

Examples:

Since Github doesn't offer a way to auto-detect spam PRs, and Digital Ocean doesn't appear interested in changing incentives, it sounds like it is up to someone else to figure out a solution.

Proposal

I am thinking of making a Github app/bot thing that will operate during ~October and check all new pull requests to your repo.

Most of the pull requests have similar formats, or trivial changes that are not useful. I think that an app/bot thing could detect ~70% of them with enough accuracy to auto-label as spam and then close.

The bot could also leave a comment that is essentially "Your PR looked like spam, sorry if that's not true, please take this recaptcha test to prove you are not a bot."

If there was a recaptcha, then I think the spam checking could be a little looser, so that it would flag some things as spam that weren't actually spam--if it was by a real person, they could prove it pretty easily.

Once the recaptcha test (or whatever) was passed, the PR would re-open and the spam tag would be removed.

Permissions

As an app, based on my reading of the Github docs, you would need to give this app the following scopes to do the things in the proposal:

  • public_repo - Limits access to public repositories. That includes read/write access to code, commit statuses, repository projects, collaborators, and deployment statuses for public repositories and organizations.

One other permission might be notifications, which would be used by the bot to remove notifications from your notification center for any PR that's marked as spam.\

The permission for notifications says:

Grants:
read access to a user's notifications
mark as read access to threads
watch and unwatch access to a repository, and
read, write, and delete access to thread subscriptions.

Question

Would you, as an open source maintainer, be interested in such a tool?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment