An intelligent CI/CD pipeline tool that automatically reviews GitHub Pull Requests using OpenAI's GPT-4.
Code reviews are essential but time-consuming. This project automates the first line of defense in the code review process. By utilizing GitHub Actions and the OpenAI API, this tool listens for new Pull Requests, fetches the code diffs, analyzes the logic for bugs, security flaws, and performance issues, and posts a professional review directly as a PR comment.
Key Features:
- β‘ Automated Triggering: Runs instantly when a PR is opened or updated.
- π§ Context-Aware Analysis: Uses GPT-4 to understand complex code changes.
- π‘οΈ Secure: Uses environment variables and GitHub Secrets so API keys are never exposed.
- ποΈ Clean Architecture: Built with Object-Oriented Python, Type Hinting, and logging.
ai-pr-reviewer/
βββ .github/workflows/
β βββ ai-review.yml # CI/CD Pipeline Configuration
βββ src/
β βββ ai_agent.py # OpenAI API Handler
β βββ github_manager.py # PyGitHub API Handler
β βββ main.py # Execution & Logging logic
βββ requirements.txt # Python Dependencies
βββ README.md