A Python script to detect and block mass-following bot accounts from your GitHub profile. This script is designed to run daily via GitHub Actions.
- Scans your followers
- Detects accounts following over a threshold (default: 5000)
- Blocks suspected bots
- Automates daily cleanup using GitHub Actions
git clone https://github.com/michaelachrisco/anti-mass-follow-bot.git
cd block-github-bots
- Go to GitHub Developer Settings
- Create a token with the following scopes:
read:user
user:follow
- Save this token as a GitHub Secret named
GH_TOKEN
- Edit
.github/workflows/bot-blocker.yml
- Replace
your-github-username
with your actual GitHub username
You can also run the script locally:
export GITHUB_USERNAME=your-username
export GH_TOKEN=your-token
python main.py
Scanning followers of @michaelachrisco...
Found 182 followers.
Neustradamus is a suspected bot. Blocking...
Blocked Neustradamus
...
LinuxJS is a suspected bot. Blocking...
Blocked LinuxJS
This project includes a workflow that runs daily at 2 AM UTC to:
- Fetch followers
- Identify suspected bots
- Block them automatically
You can trigger the workflow manually via the GitHub Actions tab as well.
Feel free to fork! If you do, make sure you add in the token credentials detailed on #2 and you will have your very own script running at 2 AM blocking accounts with over 5000 followers. Enjoy!