Pull-Shark-Automation
Pull-Shark-Automation copied to clipboard
Automate GitHub PR creation at scale with intelligent token rotation, proxy support, and real-time notifications. Create thousands of PRs effortlessly using sequential or high-speed parallel modes (62...
๐ฆ GitHub Pull Shark Automation
โ ๏ธ Educational Purpose Only
This tool is designed for educational purposes to understand GitHub automation, CI/CD workflows, and API integration. Use responsibly and in accordance with GitHub's Terms of Service.
๐ Earn Your Pull Shark Badge
![]() Default 2 PRs |
![]() Bronze 16 PRs |
![]() Silver 128 PRs |
![]() Gold 1024 PRs |
Automate PR creation and merging to unlock all achievement tiers!
๐ฏ What Is Pull Shark Automation?
A powerful Python automation framework that streamlines GitHub Pull Request workflows at scale. Perfect for developers who want to:
| ๐ฏ Use Case | ๐ Benefit |
|---|---|
| Batch Documentation Updates | Update README files across multiple branches |
| Configuration Management | Apply settings changes repository-wide |
| CI/CD Testing | Stress-test your automation pipelines |
| Achievement Hunting | Earn GitHub badges efficiently |
| Learning & Research | Study automation patterns and workflows |
๐ Table of Contents
| ๐ Features | ๐๏ธ Architecture | ๐ฆ Installation | โ๏ธ Configuration |
|---|---|---|---|
| ๐ Usage | ๐ง Components | โก Performance | ๐ Security |
| ๐ Troubleshooting | ๐ Optimization | ๐ค Contributing | ๐ License |
๐ Features
๐ฏ Core Capabilities
|
๐ง Advanced Features
|
๐ฌ How It Works
%%{init: {'theme':'dark','themeVariables': {'primaryColor':'#ff6b6b','primaryTextColor':'#fff','primaryBorderColor':'#ff6b6b','lineColor':'#4ecdc4','secondaryColor':'#ffe66d','tertiaryColor':'#a8dadc'}}}%%
graph TB
Start([๐ Start Automation]) --> Config[๐ Load Configuration]
Config --> Mode{๐ Choose Mode}
Mode -->|Sequential| Seq[๐ main.py<br/>Single Thread]
Mode -->|Parallel| Par[โก parallel_automation.py<br/>Multi-Thread]
Seq --> Git[๐ง Git Operations]
Par --> Git
Git --> Branch[๐ฟ Create Branch]
Branch --> Commit[๐พ Commit Changes]
Commit --> Push[๐ค Push to Remote]
Push --> PR[๐ฏ Create PR]
PR --> AutoMerge{๐ค Auto-merge?}
AutoMerge -->|Yes| Merge[โ
Merge PR]
AutoMerge -->|No| Next{๐ More PRs?}
Merge --> Next
Next -->|Yes| Git
Next -->|No| Notify[๐ข Send Notifications]
Notify --> End([๐ Complete!])
style Start fill:#2ecc71,stroke:#27ae60,stroke-width:3px,color:#fff
style End fill:#e74c3c,stroke:#c0392b,stroke-width:3px,color:#fff
style PR fill:#3498db,stroke:#2980b9,stroke-width:2px,color:#fff
style Merge fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:#fff
๐๏ธ Architecture
System Design Overview
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฆ Pull Shark Automation โ
โ Core Orchestration Layer โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโผโโโโโโโโโ โโโโโโโโโโผโโโโโโโโ
โ ๐ Sequential โ โ โก Parallel โ
โ main.py โ โ parallel_*.py โ
โ Reliable โ โ Fast & Async โ
โโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโ
โ โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโผโโโโโโ โโโโโโโผโโโโโ โโโโโโโโผโโโโโโ
โ ๐ง Git โ โ ๐ GitHubโ โ ๐ Token โ
โ Manager โ โ Tool โ โ Manager โ
โ Ops โ โ API Wrap โ โ Rotation โ
โโโโโโฌโโโโโโ โโโโโโโฌโโโโโ โโโโโโโโฌโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโผโโโโโโ โโโโโโผโโโโโโ โโโโโโผโโโโโโ
โ ๐ Proxy โ โ ๐ข Notifyโ โ ๐ Loggerโ
โ Rotation โ โ Webhooks โ โ System โ
โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
๐ Component Matrix
| Component | Role | Performance | Features |
|---|---|---|---|
| main.py | ๐ Sequential | โญโญโญโญโญ Stable | Single-thread, persistent |
| parallel_automation.py | โก Parallel | โญโญโญโญโญ Fast | Multi-thread, async |
| git_manager.py | ๐ง Git Ops | โญโญโญโญ | Branch, commit, push |
| github_tool.py | ๐ API | โญโญโญโญ | PR create/merge, limits |
| token_manager.py | ๐ Tokens | โญโญโญโญโญ | Multi-token rotation |
| proxy_manager.py | ๐ Proxies | โญโญโญ | Scraping & rotation |
| notifier.py | ๐ข Alerts | โญโญโญโญ | Discord & Slack |
| logger.py | ๐ Logs | โญโญโญโญโญ | File & console |
๐ฆ Installation
๐ Quick Start Guide
Prerequisites Checklist
โ
Python 3.8 or higher
โ
Git 2.0 or higher
โ
GitHub CLI (gh)
โ
Active GitHub account
โ
Write access to target repository
Step 1๏ธโฃ: Clone Repository
๐ฅ Download the Code
# Clone via HTTPS
git clone https://github.com/itxashancode/Pull-Shark-Automation.git
# Or clone via SSH
git clone [email protected]:itxashancode/Pull-Shark-Automation.git
# Navigate to directory
cd Pull-Shark-Automation
Step 2๏ธโฃ: Install Dependencies
๐ Python Packages
# Install all required packages
pip install -r requirements.txt
# Or use pip3 on some systems
pip3 install -r requirements.txt
๐ฆ What Gets Installed:
| Package | Purpose | Version |
|---|---|---|
requests |
HTTP/API calls | โฅ2.28.0 |
aiohttp |
Async HTTP client | โฅ3.8.5 |
aiofiles |
Async file operations | โฅ23.1.0 |
gitpython |
Git automation | โฅ3.1.31 |
beautifulsoup4 |
HTML parsing | โฅ4.12.0 |
colorama |
Terminal colors | โฅ0.4.6 |
schedule |
Task scheduling | โฅ1.2.0 |
Step 3๏ธโฃ: Install GitHub CLI
๐ macOS Installation
# Using Homebrew
brew install gh
# Verify installation
gh --version
๐ง Linux Installation
# Debian/Ubuntu
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | \
sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | \
sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
# Fedora/RHEL/CentOS
sudo dnf install gh -y
# Arch Linux
sudo pacman -S github-cli
# Verify installation
gh --version
๐ช Windows Installation
# Using winget
winget install --id GitHub.cli
# Or using Chocolatey
choco install gh
# Or using Scoop
scoop install gh
# Verify installation
gh --version
Step 4๏ธโฃ: Authenticate GitHub
๐ Login to GitHub
# Start authentication
gh auth login
# Follow the interactive prompts:
# 1. Choose: GitHub.com
# 2. Protocol: HTTPS
# 3. Authenticate Git: Yes
# 4. Method: Login with a web browser
# Verify authentication
gh auth status
Expected Output:
โ Logged in to github.com as YourUsername
โ Git operations for github.com configured to use https protocol.
โ Token: *******************
โ Installation Complete!
Ready to configure? Proceed to โ๏ธ Configuration
โ๏ธ Configuration
๐๏ธ Setup Your Automation
๐ File 1: Main Config (config.json)
{
"repo_path": ".",
"base_branch": "main",
"readme_file": "README.md",
"pr_count": 2000,
"delay_seconds": 30,
"auto_merge": true,
"dry_run": false,
"max_retries": 3,
"use_free_proxies": true,
"max_concurrent": 10,
"discord_webhook": "https://discord.com/api/webhooks/YOUR_WEBHOOK_HERE",
"slack_webhook": "https://hooks.slack.com/services/YOUR_WEBHOOK_HERE"
}
๐ Configuration Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
repo_path |
string | "." |
Path to your Git repository |
base_branch |
string | "main" |
Target branch for PRs |
readme_file |
string | "README.md" |
File to modify in each commit |
pr_count |
integer | 2000 |
Total PRs to create |
delay_seconds |
integer | 30 |
Wait time between PRs (sequential) |
auto_merge |
boolean | true |
Automatically merge created PRs |
dry_run |
boolean | false |
Test mode (no actual changes) |
max_retries |
integer | 3 |
Retry attempts on failure |
use_free_proxies |
boolean | true |
Enable proxy rotation |
max_concurrent |
integer | 10 |
Parallel workers (parallel mode) |
discord_webhook |
string | "" |
Discord notification URL |
slack_webhook |
string | "" |
Slack notification URL |
๐ File 2: GitHub Tokens (github_tokens.json)
{
"tokens": [
{
"name": "Primary Token",
"token": "github_pat_11XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
{
"name": "Secondary Token",
"token": "github_pat_11XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
{
"name": "Backup Token",
"token": "github_pat_11XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
]
}
๐ How to Generate GitHub Tokens
Step-by-Step Guide:
-
Navigate to GitHub Settings
- Click your profile โ Settings
- Developer settings โ Personal access tokens โ Tokens (classic)
-
Generate New Token
- Click "Generate new token (classic)"
- Name:
Pull Shark Automation - Expiration:
90 days(recommended)
-
Select Required Scopes โ
- โ๏ธ
repo- Full control of private repositories - โ๏ธ
workflow- Update GitHub Action workflows - โ๏ธ
write:packages- Upload packages
- โ๏ธ
-
Generate & Copy Token
- Click "Generate token"
- โ ๏ธ Copy immediately (shown only once!)
- Add to
github_tokens.json
๐ Rate Limits:
- Single token: 5,000 requests/hour
- Multiple tokens: Rotates automatically for 15,000+/hour
๐ Security Tips:
- Never commit tokens to Git
- Rotate every 30-90 days
- Use fine-grained tokens when possible
- Enable 2FA on your account
๐ File 3: Proxies (proxies.txt)
# Free HTTPS proxies (ip:port format)
8.219.97.248:9090
47.91.34.69:3128
161.35.70.249:8080
165.227.196.37:3128
64.225.4.5:9999
# Authenticated proxies (protocol://user:pass@ip:port)
http://username:[email protected]:8080
socks5://admin:[email protected]:1080
๐ Finding & Testing Proxies
๐ Free Proxy Sources:
- free-proxy-list.net - Updated hourly
- proxyscrape.com - API available
- spys.one - Global proxies
๐งช Test Proxies:
# Test single proxy
curl -x http://8.219.97.248:9090 https://api.github.com/
# Test with timeout
curl -x http://proxy:port --max-time 5 https://api.github.com/
โ ๏ธ Proxy Reliability:
| Type | Reliability | Speed | Cost |
|---|---|---|---|
| Free | โญโญ Low | Slow | $0 |
| Paid | โญโญโญโญโญ High | Fast | $10-50/mo |
| Premium | โญโญโญโญโญ Very High | Very Fast | $50-200/mo |
๐ฐ Recommended Paid Services:
- Bright Data - Enterprise grade
- Smartproxy - Good balance
- Oxylabs - Large pool
- Proxy-Cheap - Budget friendly
๐ Optional: Webhook Setup
๐ฌ Discord Webhook
Setup Steps:
- Open Discord server
- Server Settings โ Integrations โ Webhooks
- Click "New Webhook"
- Set name:
GitHub Botor similar - Choose target channel
- Click "Copy Webhook URL"
- Paste into
config.json
Webhook Format:
https://discord.com/api/webhooks/1234567890/ABCDEFGHIJKLMNOPQRSTUVWXYZ
Test Webhook:
curl -X POST "YOUR_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{"content": "Test message from Pull Shark!"}'
๐ผ Slack Webhook
Setup Steps:
- Go to api.slack.com/apps
- Create New App โ From scratch
- App Name:
GitHub Automation - Select workspace
- Incoming Webhooks โ Activate
- Add New Webhook to Workspace
- Select channel
- Copy webhook URL
- Paste into
config.json
Webhook Format:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXX
Test Webhook:
curl -X POST "YOUR_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{"text": "Test from Pull Shark!"}'
โ Configuration Complete!
Next: ๐ Usage Guide
๐ Usage
๐ฎ Command Center
๐ Quick Start Commands
# 1๏ธโฃ Basic sequential run
python main.py
# 2๏ธโฃ Fast parallel mode (recommended)
python parallel_automation.py --count 100 --concurrent 10
# 3๏ธโฃ Test without creating PRs
python main.py --dry-run
# 4๏ธโฃ Custom PR count
python main.py --count 500
# 5๏ธโฃ Resume after interruption
python main.py # Auto-resumes from state.json
๐ Sequential Mode (main.py)
python main.py [OPTIONS]
โญ Best For: Reliability, debugging, small batches (<500 PRs)
| Option | Description | Example |
|---|---|---|
--count N |
Override PR count | python main.py --count 200 |
--delay N |
Seconds between PRs | python main.py --delay 60 |
--dry-run |
Test mode (no commits) | python main.py --dry-run |
--no-merge |
Disable auto-merge | python main.py --no-merge |
--reset |
Start from PR #1 | python main.py --reset |
--use-proxies |
Enable proxy rotation | python main.py --use-proxies |
๐ Example Output:
๐ Starting from PR #1
โฑ๏ธ Delay: 30 seconds
๐น Processing PR #1
โโ ๐ฟ Created branch: automation-1-a1b2c3d4
โโ ๐พ Committed changes
โโ ๐ค Pushed to remote
โโ โ
PR #12345 created successfully
โ
PR #12345 merged successfully
โฑ๏ธ Waiting 30 seconds...
๐น Processing PR #2
...
โก Parallel Mode (parallel_automation.py)
python parallel_automation.py [OPTIONS]
โญ Best For: Speed, large batches (500-10,000 PRs)
| Option | Description | Example |
|---|---|---|
--count N |
Number of PRs | --count 1000 |
--concurrent N |
Parallel workers | --concurrent 20 |
--start N |
Starting PR number | --start 100 |
--no-proxy |
Disable proxies | --no-proxy |
--dry-run |
Test mode | --dry-run |
๐ Example Output:
๐ Initializing parallel automation...
๐ Loaded 3 GitHub tokens
๐ Fetching proxies...
๐ฆ Total unique proxies collected: 342
โ
Working proxies: 87
๐ Starting parallel automation
๐ Progress: 134/200 PRs
โ Success: 130
โ Failed: 4
โก Speed: 45.2 PRs/min
๐ Automation Complete!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total: 200 PRs
โ
Success: 196 (98%)
โ Failed: 4 (2%)
โก Speed: 43.8 PRs/min
โฑ๏ธ Time: 4 minutes 34 seconds
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Usage Examples
Example 1: First-Time Setup (Bronze Badge)
Goal: Earn Bronze Pull Shark Badge (16 PRs)
# Test with dry run first
python main.py --count 20 --dry-run
# Run actual automation
python main.py --count 20 --delay 15
# Expected time: ~5 minutes
Output:
๐ Starting from PR #1
โฑ๏ธ Delay: 15 seconds
โ
PR #1-20 created successfully
๐ Bronze Pull Shark Badge unlocked!
Example 2: Silver Badge (Parallel Mode)
Goal: Earn Silver Pull Shark Badge (128 PRs)
# High-speed parallel mode
python parallel_automation.py --count 150 --concurrent 15
# Expected time: ~3-5 minutes
Output:
๐ Starting parallel automation
๐ 150/150 โ 147 โ 3 โก 42.5 PRs/min
๐ Silver Pull Shark Badge unlocked!
โฑ๏ธ Completed in 3 minutes 32 seconds
Example 3: Gold Badge (Maximum Speed)
Goal: Earn Gold Pull Shark Badge (1024 PRs)
# Ultra-fast mode with 20 workers
python parallel_automation.py \
--count 1024 \
--concurrent 20
# Expected time: ~16-20 minutes with 3 tokens
Output:
๐ Initializing parallel automation...
๐ Loaded 3 tokens
๐ Working proxies: 87
๐ 1024/1024 โ 982 โ 42 โก 62.5 PRs/min
๐๐๐ GOLD PULL SHARK UNLOCKED! ๐๐๐
โฑ๏ธ Completed in 16 minutes 23 seconds
Example 4: Resume After Interruption
Scenario: Process interrupted at PR #350
# Check current state
cat state.json
# Output: {"last_completed_pr": 350}
# Resume from PR #351
python main.py --count 500
# Automatically continues from #351
Output:
๐ Resuming from PR #351 (found state.json)
โฑ๏ธ Remaining: 150 PRs
๐น Processing PR #351
...
Example 5: Dry Run Testing
Goal: Test configuration without creating PRs
python main.py --count 5 --dry-run
Output:
๐ DRY RUN MODE - No actual commits
๐น PR #1 Simulation
๐ Would create branch: automation-1-abc123
๐ Would modify: README.md
๐ Would commit: "Automated update #1"
๐ Would push to: origin/automation-1-abc123
๐ Would create PR with title: "Automated PR #1"
โ
Simulation successful
๐น PR #2 Simulation
...
โ
All 5 PRs simulated successfully
๐ก Pro Tips
| ๐ฏ Tip 1 | Start with --dry-run to test your configuration |
| โก Tip 2 | Use parallel mode with multiple tokens for maximum speed |
| ๐ Tip 3 | State files allow resuming - don't worry about interruptions |
| ๐ Tip 4 | Monitor rate limits: gh api rate_limit |
| ๐ Tip 5 | Enable proxies for extra speed and reliability |
๐ง Components Deep Dive
๐๏ธ System Architecture Breakdown
1๏ธโฃ GitManager (git_manager.py)
๐ฏ Purpose: Handle all Git operations with retry logic and internet connectivity checks
๐ Key Methods:
class GitManager:
def __init__(self, base_branch: str, max_retries: int, logger)
def wait_for_internet(self, timeout: int = 10) -> bool:
"""Wait for stable internet connection"""
def run(self, command: List[str]) -> subprocess.CompletedProcess:
"""Execute git command with exponential backoff retry"""
def sync_base(self) -> bool:
"""Sync base branch with remote"""
def create_branch(self, name: str) -> bool:
"""Create and checkout new branch"""
def commit(self, file: str, message: str) -> bool:
"""Stage and commit changes"""
def push(self, branch: str) -> bool:
"""Push branch to remote"""
โจ Features:
| โฑ๏ธ Exponential Backoff | Retry delays: 5s โ 10s โ 20s |
| ๐ Internet Check | Validates connection before operations |
| ๐ Auto-Retry | Configurable attempts (default: 3) |
| โฒ๏ธ Timeout Protection | 30-second command timeout |
2๏ธโฃ GitHubTool (github_tool.py)
๐ฏ Purpose: Wrap GitHub CLI with rate limit management and PR operations
๐ Key Methods:
class GitHubTool:
def check_rate_limit(self) -> Dict:
"""Query GitHub API rate limit status"""
def create_pr(self, title: str, body: str, head: str) -> Optional[str]:
"""Create pull request via GitHub CLI"""
def merge_pr(self, branch: str) -> bool:
"""Auto-merge pull request"""
๐ Rate Limit Flow:
%%{init: {'theme':'dark'}}%%
graph LR
A[Check Rate Limit] --> B{Remaining > 100?}
B -->|Yes| C[Proceed]
B -->|No| D[Calculate Wait Time]
D --> E[Sleep Until Reset]
E --> A
style A fill:#3498db
style C fill:#2ecc71
style D fill:#f39c12
3๏ธโฃ TokenManager (token_manager.py)
๐ฏ Purpose: Manage multiple GitHub tokens with automatic rotation
๐ Rotation Algorithm:
def get_best_token():
"""
1. Filter active tokens โ
2. Sort by remaining requests (descending) โฌ๏ธ
3. Return token with highest limit โญ
4. Update last_used timestamp ๐
5. Decrement remaining count โ
"""
๐ Token Statistics Example:
๐ Token Status Dashboard
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Token 1 (Primary): 4,850 / 5,000 โก
Token 2 (Secondary): 5,000 / 5,000 โ
Token 3 (Backup): 4,920 / 5,000 โก
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total Available: 14,770 requests
Next Reset: 42 minutes
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
4๏ธโฃ ProxyManager (proxy_manager.py)
๐ฏ Purpose: Rotate proxies to distribute requests
๐ Rotation Strategy:
# Round-robin with queue
proxy1 โ proxy2 โ proxy3 โ proxy1 โ ...
# Get proxy (auto-rotates)
proxy = proxy_queue.get() # Returns proxy1
proxy_queue.put(proxy) # Re-add to end
# Next: proxy2, then proxy3, then proxy1...
๐ Supported Formats:
# Simple proxies
"8.219.97.248:9090"
"http://47.91.34.69:3128"
# Authenticated proxies
"http://user:[email protected]:8080"
"socks5://admin:[email protected]:1080"
5๏ธโฃ Notifier (notifier.py)
๐ฏ Purpose: Send real-time notifications
๐จ Notification Types:
| Level | Color | Discord | Use Case |
|---|---|---|---|
info |
๐ต Blue | 5814783 | Progress updates |
success |
๐ข Green | 3066993 | PR created/merged |
warning |
๐ก Yellow | 16776960 | Non-critical errors |
error |
๐ด Red | 15548997 | Critical failures |
๐จ Example Notifications:
# Success
notifier.send(
"โ
PR #123 created successfully\n"
"Branch: automation-123-abc\n"
"PR Number: #456",
"success"
)
# Progress
notifier.send(
"๐ Progress: 50/100 PRs\n"
"Speed: 12.5 PRs/min",
"info"
)
# Error
notifier.send(
"โ PR #75 failed\n"
"Error: Network timeout",
"error"
)
6๏ธโฃ Logger (logger.py)
๐ฏ Purpose: Dual-output logging system
๐ Log Levels:
logger.info("โ
PR #123 created") # General info
logger.warning("โ ๏ธ Rate limit low") # Warnings
logger.error("โ Failed to push") # Errors
logger.debug("๐ Token: abc...") # Debug info
๐ Sample Log Output:
2026-02-15 10:22:11 - INFO - Starting automation from PR #1
2026-02-15 10:22:15 - INFO - Created branch automation-1-abc123
2026-02-15 10:22:18 - INFO - Committed changes to README.md
2026-02-15 10:22:22 - INFO - Pushed branch automation-1-abc123
2026-02-15 10:22:25 - INFO - Created PR #12345
2026-02-15 10:22:28 - INFO - Merged PR #12345
2026-02-15 10:22:28 - WARNING - Rate limit: 4850 remaining
โก High-Performance Modules
๐ Turbocharged Async Implementation
The high_performance package provides async-first implementations for maximum throughput and parallel processing. Fully Windows-compatible with proper event loop policies.
๐ Module Structure
high_performance/
โโโ __init__.py # ๐ฆ Package exports
โโโ git_manager.py # ๐ง Async Git operations
โโโ github_tool.py # ๐ Async GitHub API
โโโ token_manager.py # ๐ Async token rotation
โโโ proxy_manager.py # ๐ Async proxy scraping
โโโ proxy_refresher.py # ๐ Background maintenance
๐ Performance Comparison
| Metric | Standard | High-Performance | Improvement |
|---|---|---|---|
| PR Speed | 1-2 PRs/min | 30-50 PRs/min | โฌ๏ธ 25x faster |
| Concurrency | Single-thread | 10-50 workers | โฌ๏ธ 50x |
| Token Rotation | Manual | Automatic | โจ Smart |
| Proxy Support | Static list | Auto-fetch + test | โจ Dynamic |
| Rate Limit | Cached | Live API checks | โจ Real-time |
| Memory Usage | ~50 MB | ~300-500 MB | โฌ๏ธ 6-10x |
๐ Real-World Performance
Test: 1000 PRs with High-Performance Modules
python parallel_automation.py --count 1000 --concurrent 20
Results:
โฑ๏ธ Time: 16 minutes (vs 8+ hours sequential)
โ
Success Rate: 94%
๐ Speed: 62.5 PRs/min
๐ Token Rotation: 3 tokens cycled automatically
๐ Proxies Used: 87 working proxies
๐พ Memory: ~720 MB peak
โก1๏ธโฃ HighPerformanceGitManager
๐ฏ Key Features:
# Windows-compatible async Git operations
async def sync_base(self) -> bool:
"""Fast sync with depth=1 optimization"""
async def create_branch(self, name: str) -> bool:
"""Async branch creation"""
async def commit(self, file: str, message: str, content: str) -> bool:
"""Single-operation async commit"""
async def push(self, branch: str) -> bool:
"""Non-blocking push"""
๐ช Windows Optimization:
# Thread pool prevents blocking
self.executor = ThreadPoolExecutor(max_workers=10)
# Run git ops in executor
loop = asyncio.get_event_loop()
result = await loop.run_in_executor(
self.executor,
lambda: git_operation()
)
โก2๏ธโฃ HighPerformanceGitHubTool
๐ฏ Key Features:
- Semaphore Control: Limit concurrent API calls
- Smart Token Selection: Auto-switch on rate limits
- Proxy Integration: Built-in proxy support
# Concurrency control
self.semaphore = asyncio.Semaphore(50) # Max 50 concurrent
async with self.semaphore:
process = await asyncio.create_subprocess_exec(...)
โก3๏ธโฃ HighPerformanceTokenManager
๐ฏ Key Features:
- Real-Time Rate Limits: Live API checks every 5 minutes
- Fair Distribution: Shuffle tokens for balanced usage
- Auto-Refresh: Update stale token status
# Live rate limit check
async def check_token_rate_limit_async(self, token):
headers = {'Authorization': f"token {token['token']}"}
async with session.get('https://api.github.com/rate_limit', headers=headers):
# Get real-time remaining count
return remaining, reset_time
โก4๏ธโฃ HighPerformanceProxyManager
๐ฏ Proxy Sources:
sources = [
# HTML Table Sources
'https://free-proxy-list.net/',
'https://www.sslproxies.org/',
# API/Raw Sources (More Reliable)
'https://api.proxyscrape.com/v2/',
'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt',
'https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt'
]
๐งช Concurrent Testing:
# Test 50 proxies simultaneously
semaphore = asyncio.Semaphore(50)
async def limited_test(proxy):
async with semaphore:
return await self.test_proxy(proxy)
# Parallel execution
results = await asyncio.gather(*[limited_test(p) for p in proxies])
โก Latency-Based Sorting:
# Sort by speed (fastest first)
working_proxies.sort(key=lambda x: x.get("latency", 999))
โก5๏ธโฃ ProxyRefresher
๐ฏ Background Service
# Run in separate terminal
python -m high_performance.proxy_refresher
Output:
๐ Proxy Refresher Started
โฐ Will refresh proxies every 30 minutes
[10:00:00] Refreshing proxies...
๐ Fetching from free-proxy-list...
๐ Fetching from proxyscrape...
๐ฆ Collected: 342 unique proxies
๐ฆ Testing: 342 proxies...
โ
Working: 87 proxies
[10:30:00] Refreshing proxies...
...
๐ Security & Best Practices
๐ก๏ธ Keep Your Tokens Safe
๐ Token Security Checklist
| โ | Never commit tokens to Git | Add to .gitignore |
| โ | Use environment variables | export GITHUB_TOKEN="ghp_xxx" |
| โ | Rotate tokens regularly | Every 30-90 days |
| โ | Use fine-grained tokens | Limit scope to specific repos |
| โ | Enable 2FA | Extra security layer |
| โ | Monitor token usage | gh api rate_limit |
๐ก๏ธ API Rate Limits
GitHub Limits:
| Authentication | Requests/Hour | Notes |
|---|---|---|
| Unauthenticated | 60 | Very limited |
| OAuth Token | 5,000 | Per token |
| GitHub App | 15,000 | Enterprise |
| Multiple Tokens | 15,000+ | Rotation |
๐ Rate Limit Strategies:
# 1๏ธโฃ Token Rotation
token = token_manager.get_best_token()
# 2๏ธโฃ Monitor Limits
rate_info = gh.check_rate_limit()
if rate_info["remaining"] < 100:
time.sleep(wait_time)
# 3๏ธโฃ Exponential Backoff
for attempt in range(max_retries):
try:
result = api_call()
break
except RateLimitError:
time.sleep(2 ** attempt)
๐ Proxy Best Practices
๐ Free vs ๐ฐ Paid Proxies
| Feature | Free | Paid |
|---|---|---|
| Reliability | โญโญ (20-30%) | โญโญโญโญโญ (99%+) |
| Speed | Slow | Fast |
| Security | โ ๏ธ Questionable | โ Verified |
| Support | None | 24/7 |
| Cost | $0 | $10-200/mo |
| Best For | Testing | Production |
๐ฐ Recommended Paid Services:
- Bright Data - Enterprise ($500+/mo)
- Smartproxy - Balanced ($75/mo)
- Oxylabs - Premium ($300/mo)
- Proxy-Cheap - Budget ($10/mo)
๐ Troubleshooting
๐ง Common Issues & Solutions
โ Issue 1: "gh: command not found"
๐ Problem Description
GitHub CLI is not installed or not in PATH.
โ Solution
# macOS
brew install gh
# Linux (Debian/Ubuntu)
sudo apt update && sudo apt install gh -y
# Windows
winget install --id GitHub.cli
# Verify
gh --version
โ Issue 2: "Authentication failed"
๐ Problem Description
GitHub CLI not authenticated or token expired.
โ Solution
# Re-authenticate
gh auth login
# Or use token directly
echo "YOUR_TOKEN" | gh auth login --with-token
# Verify authentication
gh auth status
โ Issue 3: "API rate limit exceeded"
๐ Problem Description
Too many API requests in short time.
โ Solutions
Option 1: Add More Tokens
{
"tokens": [
{"name": "Token 1", "token": "ghp_xxx1"},
{"name": "Token 2", "token": "ghp_xxx2"},
{"name": "Token 3", "token": "ghp_xxx3"}
]
}
Option 2: Check Rate Limit
gh api rate_limit
# Output shows:
# - Remaining requests
# - Reset time
Option 3: Increase Delay
{
"delay_seconds": 60
}
โ Issue 4: "Failed to push branch"
๐ Problem Description
Git push fails due to network or permissions.
โ Solutions
Check 1: Internet Connection
ping github.com
Check 2: Repository Permissions
gh repo view --web
# Verify you have write access
Check 3: Branch Protection
gh api repos/OWNER/REPO/branches/main/protection
Check 4: Re-authenticate
gh auth refresh
โ Issue 5: "No changes to commit"
๐ Problem Description
File already contains identical content.
โ Solutions
Solution 1: Reset State
python main.py --reset
Solution 2: Change Target File
{
"readme_file": "CONTRIBUTING.md"
}
Solution 3: Force Content Change Add timestamps or unique IDs to each commit.
๐ Enable Debug Mode
# Set environment variable
export LOG_LEVEL=DEBUG
# Run with debug logging
python main.py
# Or edit logger.py
logger.setLevel(logging.DEBUG)
Debug Output Example:
DEBUG - Token selected: primary (4850 remaining)
DEBUG - Proxy selected: http://8.219.97.248:9090
DEBUG - Executing: git push origin automation-1-abc123
DEBUG - Command output: [SUCCESS]
DEBUG - API response: {"pr_number": 12345}
๐ Performance Tips
โก Maximize Your Speed
๐ Speed Optimization Matrix
| Strategy | Impact | Difficulty | Implementation |
|---|---|---|---|
| Use Parallel Mode | โญโญโญโญโญ | ๐ข Easy | python parallel_automation.py --concurrent 20 |
| Multiple Tokens | โญโญโญโญโญ | ๐ข Easy | Add 2-3 tokens to github_tokens.json |
| Enable Proxies | โญโญโญโญ | ๐ก Medium | Set "use_free_proxies": true |
| Reduce Delay | โญโญโญ | ๐ข Easy | --delay 10 (sequential mode) |
| Skip Auto-Merge | โญโญ | ๐ข Easy | --no-merge |
| Use SSD Storage | โญโญ | ๐ด Hard | Run on SSD drive |
๐พ Resource Optimization
Optimal Settings by Hardware:
| System Specs | Workers | Memory | PRs/Hour | Recommended |
|---|---|---|---|---|
| 2 CPU, 4GB RAM | 5 | ~150 MB | ~900 | ๐ข Basic |
| 4 CPU, 8GB RAM | 10 | ~300 MB | ~1,800 | ๐ข Good |
| 8 CPU, 16GB RAM | 20 | ~600 MB | ~3,600 | ๐ก Great |
| 16 CPU, 32GB RAM | 40 | ~1.2 GB | ~7,200 | ๐ด Overkill |
๐ Monitor Resources:
# CPU & Memory Usage
top -p $(pgrep -f parallel_automation)
# Disk I/O
iotop -p $(pgrep -f parallel_automation)
# Network Stats
nethogs
๐ Benchmarks
Test 1: Sequential Mode (100 PRs)
Configuration:
{
"pr_count": 100,
"delay_seconds": 30,
"auto_merge": true
}
Results:
โฑ๏ธ Time: 52 minutes
โ
Success: 98 PRs (98%)
โ Failed: 2 PRs (2%)
๐ Retries: 3 operations
๐พ Memory: ~50 MB
๐ Speed: 1.9 PRs/min
Test 2: Parallel Mode (1000 PRs, 10 workers)
Configuration:
python parallel_automation.py --count 1000 --concurrent 10
Results:
โฑ๏ธ Time: 28 minutes
โ
Success: 960 PRs (96%)
โ Failed: 40 PRs (4%)
๐ Retries: 42 operations
๐พ Memory: ~380 MB
๐ Speed: 35.7 PRs/min
Test 3: Maximum Speed (1000 PRs, 20 workers, 3 tokens)
Configuration:
python parallel_automation.py --count 1000 --concurrent 20
Results:
โฑ๏ธ Time: 16 minutes
โ
Success: 940 PRs (94%)
โ Failed: 60 PRs (6%)
๐ Retries: 68 operations
๐พ Memory: ~720 MB
๐ Speed: 62.5 PRs/min
๐ Tokens: 3 rotated
๐ Proxies: 87 used
๐ค Contributing
๐ช Join the Community
๐ How to Contribute
# 1๏ธโฃ Fork the repository
gh repo fork itxashancode/Pull-Shark-Automation
# 2๏ธโฃ Clone your fork
git clone https://github.com/YOUR_USERNAME/Pull-Shark-Automation.git
cd Pull-Shark-Automation
# 3๏ธโฃ Create feature branch
git checkout -b feature/amazing-feature
# 4๏ธโฃ Make your changes
# ... edit files ...
# 5๏ธโฃ Commit with conventional commits
git commit -m "feat: add amazing feature"
# 6๏ธโฃ Push to your fork
git push origin feature/amazing-feature
# 7๏ธโฃ Create Pull Request
gh pr create --title "Add amazing feature" --body "Description..."
๐ Code Style Guide
# โ
Good - Clear, documented, typed
def create_pull_request(title: str, body: str, head: str) -> Optional[str]:
"""
Create a pull request via GitHub CLI.
Args:
title: PR title
body: PR description
head: Source branch name
Returns:
PR number as string, or None if failed
"""
try:
result = gh_tool.create_pr(title, body, head)
return result
except Exception as e:
logger.error(f"Failed to create PR: {e}")
return None
# โ Bad - Unclear, no types, no docs
def createPR(t,b,h):
result=gh_tool.create_pr(t,b,h)
return result
๐จ Formatting Tools:
# Auto-format with black
black *.py
# Check style with flake8
flake8 *.py
# Type checking with mypy
mypy *.py
๐ Reporting Bugs
Found a bug? Help us fix it!
Steps:
- Check existing issues
- Create new issue with template
- Include:
- OS & Python version
- Full error message
- Steps to reproduce
- Expected vs actual behavior
๐ก Suggesting Features
Have an idea? We'd love to hear it!
Steps:
- Check existing discussions
- Open feature request
- Describe:
- Use case
- Proposed solution
- Alternatives considered
๐ License
MIT License
MIT License
Copyright (c) 2026 Pull Shark Automation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
๐ Acknowledgments
๐ Built With Amazing Tools
๐ Special Thanks
- GitHub - For excellent CLI and API
- Python Community - For amazing async libraries
- Contributors - Everyone who improved this project
- You - For using Pull Shark Automation!
๐ Support & Community
|
|
|
|
|
|
โญ Star History
๐ Final Words
๐ฆ Unleash the Pull Shark! ๐ฆ
If this tool helped you earn your Pull Shark badge, please โญ star the repository!
Made with โค๏ธ by developers, for developers
โฌ๏ธ Back to Top
โ ๏ธ Remember: This tool is for educational purposes. Use responsibly and follow GitHub's Terms of Service.


