Skip to content

b4lch/RepoGuard

Repository files navigation

logo RepoGuard

GitHub's missing spam blocker. The rules based GitHub App that closes and deletes spam Issues, PRs, and comments

Installation 💻

You can install RepoGuard from the GitHub Marketplace

What is RepoGuard? 📰

RepoGuard is a customisable GitHub App designed to automatically manage and block spam in your repositories. By leveraging a set of configurable rules, RepoGuard helps maintain the quality of issues, pull requests, and comments, saving you time triaging and managing contributions.

Features ✅

  • Automatically close and lock spam Issues & Pull Requests
  • Configurable spam filter rules from .yml files in your project
  • Block problematic users
  • Block unwated/offensive words
  • Block PRs that only update README files
  • Block new GitHub accounts
  • Block PRs below a minimum lines changed threshold
  • Block contributions that contain any URLs
  • Comments on closed Issues and PRs reminding contributors of the rules

Setup 👩‍💻

RepoGuard comes with a sensible set of default rules to block low quality contributions.

Creating a config file

You can configure your own rules by creating a YML file in your repo at .github/repo-guard.yml.

Example:

enabled: true

blockWordList: "block-word-list.txt"
blockWordListB64: block-word-list-base64.txt
blockUserList: block-user-list.txt

issues:
  minWords: 5
  blockAllCaps: false
  commentOnClose: "This issue has been automatically flagged as low quality/spam, and closed as a result."
  lockOnClose: false
  lockReason: "spam"
  blockWords: false
  blockUsers: false
  blockUrls: true

pullRequests:
  minLinesChanged: 0
  blockReadMeOnly: false
  commentOnClose: "This PR has been automatically flagged as low quality/spam, and closed as a result."
  lockOnClose: false
  lockReason: "off-topic"
  blockUsers: false
  blockUrls: true

comments:
  blockUsers: false

Documentation 📃

You can read the full documentation for each option here

Development & Self Hosting 👩‍💻

RepoGuard is built with Probot. For more info see: https://probot.github.io/docs/

For local development, pull this repo and install dependencies

npm install

Set APP_ID, WEBHOOK_SECRET, PRIVATE_KEY and WEBHOOK_PROXY_URL environment variables in .env file.

See probot.github.io/docs/configuration/ for more details.

See example file .env.example

Run App locally

npm start

Run tests

npm run test

Docker

# 1. Build container
docker build -t repo-guard .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> repo-guard

Contributing 🙂

Contributions are welcome! We'd also love to hear what features/config options would be helpful for you! If you have suggestions, please open an issue or submit a pull request. Please read the contributing guide before submitting.

License

ISC © 2024 b4lch

About

🛑RepoGuard | GitHub's missing spam blocker

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published