Skip to main content
← Back to workflows

How to Review Code with ChatGPT in GitHub Actions?

anc95/ChatGPT-CodeReview -
GitHub Action
v1.0.13
3,658
Contributors
Contributor - anc95Contributor - PeterDaveHello
Categories
CICUBE ANALYTICS INSIGHTS
Engineering Velocity: 25% Team Time Lost to CI Issues
View Platform →
3.5h
Time Saved/Dev/Week
40%
Faster Releases
Click for next insight
Usage
name: Code Review GitHub Action
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# Optional
LANGUAGE: Chinese
OPENAI_API_ENDPOINT: https://api.openai.com/v1
MODEL: gpt-3.5-turbo
PROMPT:
top_p: 1
temperature: 1
max_tokens: 10000
MAX_PATCH_LENGTH: 10000

ChatGPT-CodeReview logo

ChatGPT-CodeReview

🐥 A code review bot powered by ChatGPT


How to use ChatGPT in GitHub Action for code review?

CodeReview GitHub Action is a code review robot using ChatGPT. In other words, automation of code reviews on GitHub.

How it works:

  • Automated Reviews: The moment one creates a new Pull Request, the robot kicks in and performs preliminary code review; it posts its findings directly in the PR timeline and under file changes.
  • Continuous Updates: The bot at no time is idle when you push updates to your PR. It automatically re-reviews the updated files so that all changes are reviewed.
Usage
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# Optional
LANGUAGE: Chinese
OPENAI_API_ENDPOINT: https://api.openai.com/v1
MODEL: gpt-3.5-turbo
PROMPT:
top_p: 1
temperature: 1
max_tokens: 10000
MAX_PATCH_LENGTH: 10000

This will definitely help in hastening code reviews; the process will be a lot speedier and smoother. Integrates perfectly into the GitHub workflow and really helps keep high code quality without slowing down development.