{"id":29086347,"url":"https://github.com/mopemope/pr-ai-review-bot","last_synced_at":"2025-06-28T00:06:18.609Z","repository":{"id":282791096,"uuid":"949656764","full_name":"mopemope/pr-ai-review-bot","owner":"mopemope","description":"GitHub Actions for AI PR Reviewer","archived":false,"fork":false,"pushed_at":"2025-06-23T15:20:26.000Z","size":7274,"stargazers_count":4,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T19:47:29.513Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mopemope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-16T23:15:12.000Z","updated_at":"2025-06-19T07:50:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddddf0f0-3447-4cc0-b993-73e8779fa1c0","html_url":"https://github.com/mopemope/pr-ai-review-bot","commit_stats":null,"previous_names":["mopemope/pr-ai-review-bot"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/mopemope/pr-ai-review-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fpr-ai-review-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fpr-ai-review-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fpr-ai-review-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fpr-ai-review-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mopemope","download_url":"https://codeload.github.com/mopemope/pr-ai-review-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mopemope%2Fpr-ai-review-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262352626,"owners_count":23297689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-28T00:06:17.750Z","updated_at":"2025-06-28T00:06:18.558Z","avatar_url":"https://github.com/mopemope.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart PR Reviewer\n\nA GitHub Action that provides intelligent code review and release notes\ngeneration for pull requests using AI. The action automatically analyzes code\nchanges, provides specific code improvement suggestions, and generates\nstructured release notes to help streamline the code review process.\n\n## Features\n\n- Automated code review with contextual suggestions\n- Smart release notes generation categorizing changes\n- Support for multiple AI models (Claude, GPT, Gemini)\n- File change analysis and patch parsing\n- Configurable path filters for targeted reviews\n- **File type specific prompts** for enhanced review quality\n- Language-specific review support\n- File content aware review capability\n\n## Key Components\n\n- **Code Review**: Analyzes diffs and provides specific, actionable feedback\n- **Release Notes**: Automatically generates structured release notes from\n  changes\n- **Comment Management**: Posts review comments directly on the PR\n- **Patch Analysis**: Smart parsing and analysis of code changes\n- **Multi-model Support**: Flexible AI model selection for different tasks\n\n## Usage\n\nAdd to your GitHub workflow `.github/workflows/pr-review.yml`:\n\n```yaml\nname: PR AI Review\n\non:\n  pull_request:\n    types: [opened, synchronize]\n    paths:\n      - \"**.ts\"\n      - \"**.tsx\"\n      - \"**.js\"\n      - \"**.jsx\"\n      - \"**.py\"\n      - \"**.go\"\n\njobs:\n  review:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      pull-requests: write\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0 # Required to get proper diff\n\n      - uses: mopemope/pr-ai-review-bot@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}\n          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}\n        with:\n          model: |\n            google/gemini-2.0-flash-exp\n            openai/gpt-4o\n          summary_model: |\n            google/gemini-2.0-flash-exp\n            openai/gpt-3.5-turbo\n          use_file_content: true\n```\n\n## Configuration\n\nFor detailed configuration settings, please refer to [action.yml](action.yml).\n\n| Option                    | Description                                                                | Default                                                                     |\n| ------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------- |\n| `debug`                   | Enable debug logging                                                       | `false`                                                                     |\n| `path_filters`            | Path filters for review (minimatch patterns), one per line                 | See [action.yml](action.yml) for default exclusion patterns                 |\n| `disable_review`          | Skip code review                                                           | `false`                                                                     |\n| `disable_release_notes`   | Skip release notes generation                                              | `false`                                                                     |\n| `summary_model`           | Model for simple tasks like summarizing diffs                              | `openai/gpt-3.5-turbo`                                                      |\n| `model`                   | Model for review tasks                                                     | `openai/gpt-4o`                                                             |\n| `retries`                 | Number of retries for API calls                                            | `5`                                                                         |\n| `timeout_ms`              | Timeout for API calls in milliseconds                                      | `360000` (6 minutes)                                                        |\n| `release_notes_title`     | Title for the release notes                                                | `Key Changes`                                                               |\n| `system_prompt`           | System message for LLM (see [action.yml](action.yml) for default template) | Detailed review prompt                                                      |\n| `summarize_release_notes` | Prompt for generating release notes                                        | See [action.yml](action.yml) for default template                           |\n| `use_file_content`        | Include full file content in review context                                | `false`                                                                     |\n| `custom_review_policy`    | Custom policies for code review                                            | `\"\"`                                                                        |\n| `language`                | response language                                                          | `en-US`                                                                     |\n| `comment_greeting`        | Greeting message for comments                                              | `Review bot comments:`                                                      |\n| `ignore_keywords`         | Keywords to skip review (one per line)                                     | `@review-bot: ignore`, `@review-bot: no-review`, `@review-bot: skip-review` |\n| `base_url`                | Specify the URL when using OpenAI-compatible API(OpenRouter)               | `\"\"`                                                                        |\n| `file_type_prompts`       | File type specific prompts in YAML format for enhanced review quality      | `\"\"` (see [File Type Specific Prompts](#file-type-specific-prompts))        |\n\n## File Type Specific Prompts\n\nThe `file_type_prompts` feature allows you to provide specialized review\nguidelines for different programming languages and file types. This enhances the\nAI's ability to provide relevant, language-specific feedback.\n\n### Usage Example\n\n```yaml\n- name: AI Code Review\n  uses: mopemope/pr-ai-review-bot@v1\n  with:\n    file_type_prompts: |\n      javascript: |\n        Focus on ES6+ best practices and modern JavaScript patterns.\n        Check for proper async/await usage and error handling.\n        Verify performance optimizations and security considerations.\n        Look for potential memory leaks and proper event listener cleanup.\n\n      python: |\n        Focus on PEP8 compliance and Python best practices.\n        Check for proper type hints and exception handling.\n        Verify security vulnerabilities and performance issues.\n        Look for proper use of context managers and generators.\n\n      typescript: |\n        Focus on type safety and TypeScript best practices.\n        Check for proper interface definitions and generic usage.\n        Verify strict mode compliance and null safety.\n        Look for proper use of utility types and mapped types.\n\n      go: |\n        Focus on Go idioms and best practices.\n        Check for proper error handling and goroutine usage.\n        Verify memory efficiency and concurrency patterns.\n        Look for proper use of channels and context.\n\n      sql: |\n        Focus on query optimization and security.\n        Check for SQL injection vulnerabilities.\n        Verify proper indexing and performance considerations.\n        Look for proper use of transactions and constraints.\n```\n\n### Supported File Types\n\nThe system automatically detects file types based on extensions and filenames.\nSupported types include:\n\n- **Programming Languages**: `javascript`, `typescript`, `python`, `java`, `go`,\n  `rust`, `cpp`, `c`, `php`, `ruby`, `swift`, `kotlin`, `scala`, `csharp`,\n  `fsharp`\n- **Web Technologies**: `html`, `css`, `scss`, `sass`, `less`\n- **Data Formats**: `json`, `xml`, `yaml`, `toml`, `ini`\n- **Database**: `sql`\n- **Documentation**: `markdown`, `rst`, `latex`\n- **Configuration**: `docker`, `shell`, `powershell`, `gitignore`, `env`\n- **And many more...**\n\ndefault system_prompt:\n\n```text\nYou are a highly meticulous and logically rigorous software development assistant.\nYour approach is characterized by strict validation, self-reflection, and iterative analysis, ensuring that your reviews are consistent and insightful.\nYou act as a highly experienced software engineer, performing in-depth reviews of modified code (code hunks) and providing concrete code snippets for improvement.\n\n### Key Review Areas\nYou will analyze the following critical aspects to identify and resolve issues, improving overall code quality:\n\n- Logical accuracy and soundness\n- Security vulnerabilities and risks\n- Performance and optimization\n- Potential data races and concurrency issues\n- Consistency and predictable behavior\n- Appropriate error handling\n- Maintainability and readability\n- Modularity and reusability\n- Complexity management (keeping the design simple and comprehensible)\n- Best practices (e.g., DRY, SOLID, KISS, etc.)\n\n### Areas to Avoid Commenting On\n- Minor code style issues (e.g., indentation, naming conventions, etc.)\n- Lack of comments or documentation\n\n### Review Guidelines\n- Maintain consistent evaluation criteria to ensure stable and reliable feedback.\n- Focus on identifying and resolving significant issues while deliberately ignoring trivial ones.\n- Provide specific improvement suggestions, including code snippets whenever possible.\n- Deliver feedback based on deep analysis rather than surface-level observations.\n```\n\n## Specifying AI Models\n\nThis action supports multiple AI providers. When specifying models, you can use\neither the short model name (which defaults to OpenAI) or the fully qualified\nname with provider prefix.\n\n### Model Format\n\nModels are specified using the format: `provider/model_name` or simply\n`model_name` .\n\n### Supported Providers\n\n- **OpenAI**: `openai/gpt-4`, `openai/gpt-3.5-turbo`, or just `gpt-4`,\n  `gpt-3.5-turbo` ...\n- **Google Gemini**: `google/gemini-pro`, `google/gemini-1.5-pro` ...\n- **Anthropic Claude**: `anthropic/claude-3-haiku`, `anthropic/claude-3-sonnet`\n- **OpenRouter**: `openrouter/deepseek/deepseek-chat:free`,\n  `openrouter/mistralai/mistral-small-3.1-24b-instruct:free` ...\n\nWhen using OpenRouter, please set the URL with the base_url option.\n\n### Examples\n\n```yaml\n# Using OpenAI model (explicit provider)\nmodel: openai/gpt-4o\nsummary_model: openai/gpt-4o\n\n# Using Google Gemini model\nmodel: google/gemini-pro\nsummary_model: google/gemini-1.5-pro\n\n# Using Anthropic Claude model\nmodel: anthropic/claude-3-sonnet\nsummary_model: anthropic/claude-3-haiku\n\n# OpenRouter\nmodel: openrouter/deepseek/deepseek-chat:free\nsummary_model: openrouter/deepseek/deepseek-chat:free\n\n```\n\n## Model Fallback Mechanism\n\nThis action includes a robust model fallback system to ensure reliability in\ncase of API failures or model-specific issues:\n\n- If the primary model fails (e.g., due to API errors, rate limits, context\n  limitations), the action will automatically attempt to use fallback models.\n- The fallback order follows the sequence specified in the model configuration.\n\n### How Fallback Works\n\n- **API Errors**: If an API call fails with a specific model, the system will\n  retry with an alternative model after the configured number of retries.\n- **Context Limitations**: If a large review exceeds the context window of the\n  primary model, a model with larger context capacity may be used if available.\n- **Provider Issues**: If a specific provider is experiencing downtime, the\n  system can switch to alternative providers if multiple API keys are\n  configured.\n\nThis mechanism ensures that your PR reviews continue to function even when\nspecific models or providers experience temporary issues, maximizing the\nreliability of your automated review workflow.\n\n### API Keys\n\nMake sure to provide the appropriate API keys as environment variables:\n\n- OpenAI(OpenRouter): `OPENAI_API_KEY`\n- Google Gemini: `GEMINI_API_KEY`\n- Anthropic Claude: `ANTHROPIC_API_KEY`\n\n## Acknowledgment\n\nThis GitHub Action is based on\n[coderabbitai/ai-pr-reviewer](https://github.com/coderabbitai/ai-pr-reviewer)\nand has been further developed with additional features and improvements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmopemope%2Fpr-ai-review-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmopemope%2Fpr-ai-review-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmopemope%2Fpr-ai-review-bot/lists"}