A GitHub App built with Probot. A probot app to try label spammy pull requests. Upon listening the news of how people were spamming legit repos with spammy PRs for a Hacktoberfest T-shirt, I decided to take matter in my own hands😎😎
What it does
If the bot feels the PR is a spammy pr, it will add "spam", "invalid", "spamprbot-reject" and "spamtober" tags in the pr, along with a personalized comment! If the bot feels the PR is legit, it adds a "spamprbot-accept" tag and a simple comment. The maintainer then can view all the pull requests by this tag and close them if required.
How it does
Assumptions were made The bot takes a dumb assumption that if a user has been assigned an issue, only then will his/her PR be seen as a legit PR. If someone who is not assigned any issue makes a contribution, their PR will me marked invalid. This may not be a perfect use case, but may be helpful for repositories who are getting tens and hundreds of such spammy PRs for hacktoberfest. If this workflow can hinder your contributions in the PR, then kindly do not use this bot
# Install dependencies npm install # Run the bot npm start
This will run the bot in localhost. You can install it in your repositories from localhost itself. The github app is currently awaiting review in marketplace.
I don't know much if JS, struggling to even parse a simple API request, so learning a bit of Node JS, Octokit and the probot framework, webhooks etc was challenging, but the results were worth it!!