Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/feiskyer/chatgpt-reviewer
Automated pull requests reviewing and issues triaging with ChatGPT.
https://github.com/feiskyer/chatgpt-reviewer
ai-assistant chatgpt code-review github-actions openai
Last synced: 3 months ago
JSON representation
Automated pull requests reviewing and issues triaging with ChatGPT.
- Host: GitHub
- URL: https://github.com/feiskyer/chatgpt-reviewer
- Owner: feiskyer
- License: apache-2.0
- Created: 2023-02-13T15:47:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-31T02:55:22.000Z (about 1 year ago)
- Last Synced: 2024-10-19T18:08:21.138Z (3 months ago)
- Topics: ai-assistant, chatgpt, code-review, github-actions, openai
- Language: Python
- Homepage:
- Size: 287 KB
- Stars: 67
- Watchers: 3
- Forks: 20
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChatGPT-Reviewer
Automated pull requests reviewing and issues triaging with ChatGPT.
## How to use
Create an OpenAI API key [here](https://platform.openai.com/account/api-keys), and then set the key as an [action secret in your repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) named `OPENAI_API_KEY`.
Finally, create a file named `.github/workflows/chatgpt-review.yml` with the following contents:
```yaml
name: ChatGPT Reviewon: [pull_request]
jobs:
chatgpt-review:
name: ChatGPT Review
runs-on: ubuntu-latest
steps:
- uses: feiskyer/ChatGPT-Reviewer@v0
name: ChatGPT Review
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
# Optional configurations:
# with:
# model: "gpt-3.5-turbo"
# temperature: 0.2
# review_per_file: true
# comment_per_file: true
```## Configurations
|Parameter|Description|Required|Default|
|---------|-----------|--------|-------|
|GITHUB_TOKEN|Github token used to send out review comments|true|""|
|OPENAI_API_KEY|API key used to invoke OpenAI|true|""|
|OPENAI_API_BASE|API based used to access Azure OpenAI|false|""|
|blocking|Blocking the pull requests on OpenAI failures|false|False|
|model|OpenAI model name|false|gpt-3.5-turbo|
|temperature|Temperature for the model|false|0.2|
|frequency_penalty|Frequency penalty for the model|false|0|
|presence_penalty|Presence penalty for the model|false|0|
|review_per_file|Send out review requests per file|false|Large changes would be reviewed per file automatically|
|comment_per_file|Post review comments per file|false|True## Samples
The ChatGPT reviewer PRs are also getting reviewed by ChatGPT, refer the [pull requests](https://github.com/feiskyer/ChatGPT-Reviewer/pulls?q=is%3Apr) for the sample review comments.
## Special notes for public repository forks
In order to protect public repositories for malicious users, Github runs all pull request workflows raised from repository forks with a read-only token and no access to secrets.
`pull_request_target` event could be used in such cases, which would run the workflow in the context of the base of the pull request (rather than in the context of the merge commit, as the `pull_request` event does).
Refer Github docs [here](https://docs.github.com/en/github-ae@latest/actions/using-workflows/events-that-trigger-workflows#pull_request_target) for more details of `pull_request_target` event.