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.
- β‘ 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.
Install github-protector directly from PyPI using pip:
pip install github-protectorFor local development and testing:
git clone https://github.com/ishandutta2007/github-protector.git
cd github-protector
pip install -e .Run this inside any git repository. It will automatically detect the owner, repo, and target main branch.
github-protectProvide specific details for fine-grained control:
github-protect --token YOUR_GITHUB_TOKEN --username ishandutta2007 --repo MyRepo --branch developExplore all available flags:
github-protect --helpYou can set up a .env file in your project root to avoid passing tokens every time:
ADMIN_TOKEN=your_personal_access_token_heregithub-protector/
βββ assets/ # Visual assets and banners
βββ github_protector/
β βββ __init__.py
β βββ cli.py # Core CLI logic
βββ pyproject.toml # Package metadata
βββ README.md # Documentation
Contributions are welcome! If you have ideas for new features or find a bug, please open an issue or submit a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE (if available) or the badge above for more information.
Developed with β€οΈ by Ishan Dutta