https://github.com/zeyu-chen/ai-code-review
An automated code review system powered by OpenAI that integrates with Git and WeChat for notifications.
https://github.com/zeyu-chen/ai-code-review
github-actions java openai wechat
Last synced: 4 months ago
JSON representation
An automated code review system powered by OpenAI that integrates with Git and WeChat for notifications.
- Host: GitHub
- URL: https://github.com/zeyu-chen/ai-code-review
- Owner: zeyu-chen
- Created: 2024-11-10T07:01:56.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-10T07:17:40.000Z (8 months ago)
- Last Synced: 2025-03-12T12:17:52.096Z (4 months ago)
- Topics: github-actions, java, openai, wechat
- Language: Java
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenAI Code Review
[](https://www.oracle.com/java/)
[](https://spring.io/projects/spring-boot)
[](https://openai.com/)
[](https://www.wechat.com/)
[](https://github.com/features/actions)An automated code review system powered by OpenAI that integrates with Git and WeChat for notifications.
## Features
- 🤖 AI-Powered Code Review - Automated code analysis using OpenAI
- 📊 Git Integration - Analyzes git diff and commits
- 💬 WeChat Notifications - Instant review notifications via WeChat
- 🔄 GitHub Actions - Automated workflow integration
- 📝 Review Logging - Stores review history in a separate repository## Tech Stack
- **Language:** Java 11
- **Framework:** Spring Boot 2.7.12
- **Build Tool:** Maven
- **AI Integration:** OpenAI
- **Version Control:** JGit
- **Messaging:** WeChat Template Messages
- **CI/CD:** GitHub Actions## Getting Started
### Prerequisites
- Java 11+
- Maven
- GitHub account
- WeChat Official Account
- OpenAI API key### Installation
1. Clone the repository
```bash
git clone [email protected]:Zeyu-Chen/AI-Podcast-App.git
cd AI-Code-Review
```2. Build with Maven
```bash
mvn clean install
```### Environment Variables
Configure the following environment variables in your GitHub repository's Settings > Secrets and Variables > Actions:
```bash
# GitHub
GITHUB_REVIEW_LOG_URI= # Review log repository URI
GITHUB_TOKEN= # GitHub personal access token
COMMIT_PROJECT= # Target project name
COMMIT_BRANCH= # Target branch name
COMMIT_AUTHOR= # Commit author
COMMIT_MESSAGE= # Commit message
WECHAT_APPID= # WeChat Official Account AppID
WECHAT_SECRET= # WeChat Official Account Secret
WECHAT_TOUSER= # WeChat user OpenID
WECHAT_TEMPLATE_ID= # Message template ID# OpenAI
OPENAI_APIHOST= # OpenAI API endpoint
OPENAI_APIKEYSECRET= # OpenAI API key
```## Project Structure
```
openai-code-review/
├── openai-code-review-sdk/ # Core SDK module
│ ├── domain/ # Domain logic
│ ├── infrastructure/ # External services
│ └── types/ # Utility classes
├── openai-code-review-test/ # Test module
└── .github/ # GitHub Actions workflows
```## Usage
The system can be used in two ways:
1. As a GitHub Action:
```yaml
name: Code Review
on: [push, pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Code Review
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```2. As a Java library:
```java
OpenAICodeReview review = new OpenAICodeReview();
review.exec();
```