Skip to content

PR Review - ChatGPT #10

PR Review - ChatGPT

PR Review - ChatGPT #10

name: PR Review - ChatGPT
on:
pull_request:
types: [opened, synchronize, reopened]
pull_request_review_comment:
types: [created]
issue_comment:
types: [created]
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
chatgpt-review:
name: ChatGPT Code Review
if: |
github.event_name == 'pull_request' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@chatgpt')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@chatgpt'))
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read review prompt
id: prompt
run: |
PROMPT=$(cat .github/prompts/pr_review.md)
echo "content<<EOF" >> $GITHUB_OUTPUT
echo "$PROMPT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: ChatGPT Code Review
uses: anc95/ChatGPT-CodeReview@6fdbaeafc6f9e0eaebb844f8cfafff67cb2947f0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL: gpt-4o
LANGUAGE: English
MAX_PATCH_LENGTH: 100000
MAX_TOKENS: 4096
PROMPT: ${{ steps.prompt.outputs.content }}