Skip to content

Test Github Workflows #9

Test Github Workflows

Test Github Workflows #9

Workflow file for this run

name: "Test Code Review"
on:
pull_request:
types: [edited]
paths-ignore:
- "*.md"
- "LICENSE"
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: "Get diff of the pull request"
id: get_diff
shell: bash
env:
PULL_REQUEST_HEAD_REF: "${{ github.event.pull_request.head.ref }}"
run: |-
git fetch origin "${{ env.PULL_REQUEST_HEAD_REF }}:${{ env.PULL_REQUEST_HEAD_REF }}"
git checkout "${{ env.PULL_REQUEST_HEAD_REF }}"
git diff "origin/${{ env.PULL_REQUEST_HEAD_REF }}" > "diff.txt"
# shellcheck disable=SC2086
echo "diff=$(cat "diff.txt")" >> $GITHUB_ENV
- uses: yu-iskw/[email protected]
name: "Code Review by GPT"
id: review
with:
openai_api_key: ${{ secrets.OPENAI_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repository: ${{ github.repository }}
github_pull_request_number: ${{ github.event.pull_request.number }}
git_commit_hash: ${{ github.event.pull_request.head.sha }}
model: "gpt-4"
temperature: "0.1"
max_tokens: "512"
top_p: "1"
frequency_penalty: "0.0"
presence_penalty: "0.0"
pull_request_diff: |-
${{ steps.get_diff.outputs.pull_request_diff }}
pull_request_chunk_size: "3500"
extra_prompt: |-
You are very familiar with python too.
log_level: "DEBUG"