A powerful GitHub Action that performs flash code review on TypeScript Pull Requests using Google's Gemini AI. This action provides intelligent, context-aware code analysis and automated review capabilities.
- Intelligent Code Analysis: Leverages Google's Gemini AI for deep code understanding
- Smart Indexing: Efficiently indexes and analyzes TypeScript codebases
- Context-Aware Reviews: Considers the broader codebase context for better insights
- Automated Workflow: Seamless integration with GitHub Actions
- Configurable Review Process: Customize review parameters and thresholds
- Multi-language Support: Review comments in multiple languages
- Token Usage Tracking: Monitor and optimize AI token consumption
- GitHub repository with TypeScript code
- Google Gemini API key
- Setup actions permissions
- Add the action to your repository's workflow:
name: Flash Review
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.ts'
- '**.tsx'
jobs:
code-review:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: TypeScript Deep Code Review
uses: DanielSuhett/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
gemini-model: 'gemini-2.0-flash'
llm-max-tokens: 5000
output-language: 'en'
auto-approve: 'false'
Enable repository setting for your workflow to create and approve pull requests.
To allow your GitHub Actions workflow to create new pull requests and submit approving reviews, you need to enable a specific repository setting.
Steps:
- Go to your repository's "Settings" tab.
- Navigate to "Actions" under "Code and automation" in the left sidebar.
- In the "Workflow permissions" section, check "Allow GitHub Actions to create and approve pull requests."
- Click "Save."
Explanation:
This setting grants the GITHUB_TOKEN
permission to create pull requests and submit approving reviews. Use with caution and ensure your workflows are secure. For more specific permissions (like commenting or requesting changes), configure the permissions
key in your workflow YAML file.
Input | Description | Required | Default |
---|---|---|---|
github-token |
GitHub token for API access | Yes | - |
gemini-api-key |
Google Gemini API key | Yes | - |
gemini-model |
Gemini model version | No | gemini-2.0-flash |
llm-max-tokens |
Maximum tokens for review | No | 5000 |
output-language |
Review output language | No | en |
auto-approve |
Auto-approve PRs | No | false |
index-cache-enabled |
Enable codebase caching | No | true |
pr-number |
PR number for manual trigger | No | - |
git clone https://github.com/DanielSuhett/flash.git
cd Flash
pnpm install
pnpm build
pnpm test
pnpm lint
pnpm lint:fix
This project is licensed under the MIT License - see the LICENSE file for details.