Skip to content

Latest commit

 

History

History
315 lines (226 loc) · 9.95 KB

File metadata and controls

315 lines (226 loc) · 9.95 KB

🚀 Pull-Merge Bot - Project Index

📋 Project Overview

Pull-Merge Bot is an advanced GitHub automation tool designed to increase repository activity and GitHub contribution graphs through intelligent automation. Built with Node.js and the GitHub API, it provides realistic, configurable activity patterns that mimic human behavior.

🎯 Key Features

🤖 Core Automation

  • Automated PR Creation: Creates pull requests from specified branches
  • Smart Code Review: Performs detailed code analysis with file-by-file review
  • Issue Management: Creates issues with customizable types and content
  • Random Chance System: Configurable probability for realistic activity patterns
  • Dual Account Support: Separate roles for invited user and repository owner

📊 Contribution Optimization

  • GitHub Graph Enhancement: Naturally increases contribution graphs
  • Review Contributions: Credits review activity to invited account
  • Issue Contributions: Creates issues that count toward contribution metrics
  • Repository Activity: Maintains consistent repository engagement

🎲 Intelligent Randomization

  • Configurable Probability: Set custom chance percentages (1-100%)
  • Natural Patterns: Makes activity look organic and human-like
  • Predictable Behavior: Same PR will have consistent behavior
  • Activity Levels: Support for low, moderate, high, and maximum activity

🏗️ Technical Architecture

Core Components

server.js (710 lines)
├── Environment Management
├── GitHub API Integration (Octokit)
├── Repository Validation
├── Branch Management
├── PR Creation & Management
├── Code Review System
├── Issue Creation System
├── Random Chance Engine
└── Error Handling & Logging

Key Functions

  • validateRepositoryAccess() - Validates both accounts have access
  • createOrUpdateBranch() - Manages branch creation and updates
  • editAndCommitReadme() - Updates README with timestamps
  • performCodeReview() - Comprehensive code analysis and review
  • createIssue() - Creates issues with custom content
  • getRandomChance() - Configurable probability engine
  • approvePR() - Separate approval system for repo owner

📁 Project Structure

pull-merge-bot/
├── server.js              # Main application (710 lines)
├── package.json           # Project configuration
├── README.md             # Comprehensive documentation
├── CONFIGURATION.md      # Detailed configuration guide
├── PROJECT_INDEX.md      # This file - project overview
├── .gitignore           # Git ignore rules
├── .env                 # Environment variables (not tracked)
└── node_modules/        # Dependencies

🔧 Dependencies

Core Dependencies

  • @octokit/rest (^22.0.0) - GitHub API client
  • dotenv (^16.5.0) - Environment variable management
  • simple-git (^3.28.0) - Git operations

System Requirements

  • Node.js: >=14.0.0
  • GitHub Tokens: With appropriate scopes
  • Repository Access: Both accounts must have access

🎯 Use Cases

1. Repository Maintenance

  • Keep repositories active and engaging
  • Maintain regular commit activity
  • Create realistic contribution patterns

2. Contribution Graph Enhancement

  • Increase GitHub contribution graphs naturally
  • Add review contributions to invited accounts
  • Create issue contributions for activity

3. Development Workflow

  • Automated code review process
  • Issue tracking and management
  • PR creation and management

4. Learning & Experimentation

  • Study GitHub API usage
  • Learn automated testing patterns
  • Understand repository automation

📊 Feature Comparison

Feature Pull-Merge Bot Other Bots
Random Chance ✅ Configurable (1-100%) ❌ Fixed or none
Code Review ✅ Detailed analysis ❌ Basic or none
Issue Creation ✅ Customizable content ❌ Limited options
Dual Account ✅ Separate roles ❌ Single account
File Analysis ✅ JS/TS/MD support ❌ Limited file types
Activity Patterns ✅ Human-like ❌ Predictable
Contribution Credits ✅ Proper attribution ❌ May not credit correctly

🚀 Getting Started

Quick Setup

# 1. Clone repository
git clone https://github.com/huzgrx/pull-merge-bot.git
cd pull-merge-bot

# 2. Install dependencies
npm install

# 3. Configure environment
cp env_default .env
# Edit .env with your GitHub tokens and settings

# 4. Run the bot
npm start

Configuration Examples

Minimal Setup

TOKEN_A=ghp_your_token_a
TOKEN_B=ghp_your_token_b
REPO_OWNER=huzgrx
REPO_NAME=your-repo
FORK_OWNER=huzgrx

Full Feature Setup

TOKEN_A=ghp_your_token_a
TOKEN_B=ghp_your_token_b
REPO_OWNER=huzgrx
REPO_NAME=your-repo
FORK_OWNER=huzgrx
BRANCH_NAME=feature-branch
CREATE_ISSUE=true
ENABLE_CODE_REVIEW=true
RANDOM_CHANCE_PERCENTAGE=50

📈 Benefits

For Developers

  • Automated Workflow: Reduces manual repository maintenance
  • Contribution Enhancement: Naturally increases GitHub activity
  • Learning Tool: Great for understanding GitHub API and automation
  • Customizable: Flexible configuration for different needs

For Repositories

  • Active Maintenance: Keeps repositories engaging and active
  • Quality Reviews: Automated code review with detailed analysis
  • Issue Tracking: Automated issue creation and management
  • Natural Patterns: Realistic activity that doesn't look automated

For Teams

  • Collaboration: Supports multiple account workflows
  • Role Separation: Clear separation of responsibilities
  • Audit Trail: Detailed logging and activity tracking
  • Scalable: Easy to configure for multiple repositories

🔍 Technical Highlights

Advanced Features

  • File Type Analysis: Special handling for JS, TS, and MD files
  • Change Metrics: Tracks additions, deletions, and total changes
  • Quality Suggestions: Context-aware recommendations
  • Error Handling: Comprehensive error management and logging
  • Validation: Thorough environment and access validation

Security & Best Practices

  • Environment Variables: Secure token management
  • Access Control: Proper permission validation
  • Error Logging: Detailed error reporting
  • Documentation: Comprehensive guides and examples

🎯 Target Audience

Primary Users

  • Developers: Wanting to maintain active GitHub profiles
  • Repository Owners: Needing automated maintenance
  • Teams: Looking for automated review processes
  • Learners: Studying GitHub API and automation

Use Cases

  • Personal Projects: Keep repositories active
  • Open Source: Maintain engagement in projects
  • Portfolio: Enhance GitHub contribution graphs
  • Learning: Study automation and API usage

📊 Metrics & Impact

Code Quality

  • 710 lines of well-documented JavaScript
  • Comprehensive error handling and validation
  • Modular architecture with clear separation of concerns
  • Extensive documentation and configuration guides

Feature Completeness

  • 100% of core features implemented
  • Configurable random chance system
  • Dual account support with proper role separation
  • Comprehensive file analysis and review system

Documentation Quality

  • Detailed README with examples and troubleshooting
  • Configuration guide with multiple examples
  • Project index for easy understanding
  • Clear setup instructions and use cases

🚀 Future Enhancements

Potential Features

  • Web Dashboard: Visual interface for monitoring
  • Multiple Repository Support: Manage multiple repos simultaneously
  • Advanced Analytics: Detailed activity reports and metrics
  • Plugin System: Extensible architecture for custom features
  • Scheduling: Configurable timing for different activities

Technical Improvements

  • TypeScript Support: Full TypeScript implementation
  • Testing Suite: Comprehensive unit and integration tests
  • CI/CD Integration: Automated deployment and testing
  • Performance Optimization: Enhanced efficiency and speed

📞 Support & Community

Documentation

  • README.md: Comprehensive setup and usage guide
  • CONFIGURATION.md: Detailed configuration options
  • PROJECT_INDEX.md: This overview document
  • Code Comments: Inline documentation throughout

Getting Help

  • Troubleshooting Guide: Common issues and solutions
  • Configuration Examples: Multiple setup scenarios
  • Error Messages: Clear and helpful error reporting
  • Community Support: GitHub issues and discussions

🎉 Why This Project Deserves Stars

🌟 Innovation

  • Unique Random Chance System: First bot with configurable probability
  • Dual Account Architecture: Proper role separation and attribution
  • Realistic Activity Patterns: Human-like behavior that doesn't look automated

🛠️ Quality

  • Well-Documented: Comprehensive guides and examples
  • Error-Resistant: Robust error handling and validation
  • Modular Design: Clean, maintainable code architecture
  • Extensible: Easy to extend and customize

🎯 Practicality

  • Solves Real Problems: Addresses actual developer needs
  • Easy to Use: Simple setup and configuration
  • Flexible: Adaptable to different use cases
  • Reliable: Consistent and predictable behavior

📚 Educational Value

  • Learning Resource: Great for studying GitHub API usage
  • Best Practices: Demonstrates proper automation patterns
  • Code Quality: Shows good JavaScript practices
  • Documentation: Exemplary project documentation

Star this project if it helps you maintain active GitHub profiles and repositories!