This workflow automates the code review process for GitHub pull requests using AI. Whenever a PR is opened or updated, the workflow fetches the file diffs, generates a detailed review prompt, and passes it to an AI model for analysis. The AI provides inline feedback comments directly on the PR. Optionally, it can also apply a ReviewedByAI label and reference team best practices stored in Google Sheets for more opinionated reviews.
✨ Features
- GitHub PR Trigger → Detects new or updated pull requests in real time.
- PR Diffs Fetching → Retrieves changed files and their code diffs using GitHub API.
- AI-Powered Code Review → Uses OpenAI (or another model) to analyze changes and provide inline comments.
- Custom Review Prompt → Builds a structured prompt for detailed, file-by-file review.
- GitHub Comment Poster → Posts AI feedback as PR comments automatically.
- Optional Labeling → Adds a “ReviewedByAI” label to PRs after review.
- Team Best Practices Integration → Connects with Google Sheets (or other sources) to enforce internal coding guidelines.