https://github.com/sarfraznawaz2005/ai-code-review-action
AI code review for pull requests or pushes
https://github.com/sarfraznawaz2005/ai-code-review-action
Last synced: about 1 month ago
JSON representation
AI code review for pull requests or pushes
- Host: GitHub
- URL: https://github.com/sarfraznawaz2005/ai-code-review-action
- Owner: sarfraznawaz2005
- License: mit
- Created: 2024-02-10T20:54:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-26T04:55:34.000Z (9 months ago)
- Last Synced: 2025-01-31T01:25:28.027Z (3 months ago)
- Language: JavaScript
- Size: 1.89 MB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gemini AI Code Review Action
This action takes as input `GIT_TOKEN` and `GEMINI_API_KEY` and watches pull/push requests and sends the git diff to AI and comments (in case of PR only) on the PR as well as sending details in email if configured.
Usage:
1 - You need to set up your project's permissions so that the Github Actions can write comments on Pull Requests. You can read more about this here: [automatic-token-authentication](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token)
2 - Set `GIT_TOKEN` and `GEMINI_API_KEY` [as action secrets in your repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository)
3 - Finally, create a file named `review-action.yml` inside `.github/workflows` with the following contents:
```
name: Gemini AI Code Review Actionon:
push:
pull_request:
types: [opened, reopened, synchronize]jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Gemini AI Code Review Action
uses: sarfraznawaz2005/ai-code-review-action@main
with:
github-token: ${{ secrets.GIT_TOKEN }}
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
email-host: 'xxxxxxxxxxxxxxxxx'
email-port: 'xxxxxxxxxxxxxxxxx'
email-user: 'xxxxxxxxxxxxxxxxx'
email-pass: 'xxxxxxxxxxxxxxxxx
email-from: 'xxxxxxxxxxxxxxxxx'
email-to: 'xxxxxxxxxxxxxxxxx'
email-bcc: 'xxxxxxxxxxxxxxxxx'
email-secure: 'true' or 'false'
```