Skip to content

ishandutta2007/github-protector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ GitHub Protector

GitHub Protector Banner

PyPI version License: MIT Python Versions GitHub followers

github-protector is a lightweight, efficient CLI tool designed for developers and DevOps engineers to instantly secure their GitHub repository branches. With a single command, you can enforce industry-standard protection rules, ensuring your codebase remains robust and stable.


πŸš€ Key Features

  • ⚑ Instant Protection: Apply branch protection rules in seconds.
  • πŸ› οΈ Zero Config: Automatically detects your repository, owner, and current user.
  • πŸ›‘οΈ Secure Defaults: Enforces Pull Request reviews and minimum approval counts.
  • πŸ”— Flexible API: Seamlessly integrates into your CI/CD pipelines.

πŸ“¦ Installation

Install github-protector directly from PyPI using pip:

pip install github-protector

For local development and testing:

git clone https://github.com/ishandutta2007/github-protector.git
cd github-protector
pip install -e .

πŸ› οΈ Usage

1. Simple Mode (Auto-detection)

Run this inside any git repository. It will automatically detect the owner, repo, and target main branch.

github-protect

2. Explicit Mode

Provide specific details for fine-grained control:

github-protect --token YOUR_GITHUB_TOKEN --username ishandutta2007 --repo MyRepo --branch develop

3. Help & Options

Explore all available flags:

github-protect --help

βš™οΈ Configuration

You can set up a .env file in your project root to avoid passing tokens every time:

ADMIN_TOKEN=your_personal_access_token_here

πŸ—ΊοΈ Project Structure

github-protector/
β”œβ”€β”€ assets/                  # Visual assets and banners
β”œβ”€β”€ github_protector/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── cli.py               # Core CLI logic
β”œβ”€β”€ pyproject.toml           # Package metadata
└── README.md                # Documentation

🀝 Contributing

Contributions are welcome! If you have ideas for new features or find a bug, please open an issue or submit a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

Distributed under the MIT License. See LICENSE (if available) or the badge above for more information.


πŸ“ˆ Star History


Developed with ❀️ by Ishan Dutta

About

🌟 Star if you like it! 🌟

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages