oonyeje-portfolio/.gitea/workflows/llm_pipeline_actions.yaml
oonyeje 333d87c62f
Some checks failed
Ollama Review / test-action (pull_request) Failing after 1m46s
continuous-integration/drone/push Build is failing
- add manual steps to code review using ollama
2025-03-07 15:05:05 -05:00

29 lines
988 B
YAML

name: 'Ollama Review'
on:
pull_request:
types: [opened, synchronize] # PR open시 자동 코드 리뷰 요청
jobs:
test-action:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v43
- name: Review code
env:
GITEA_TOKEN: ${{ secrets.token }}
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
review=$(curl -s https://ollama.bsidesolutions.net/api/generate -d '{"model": "${{ inputs.model }}", "prompt": "Review the following file:\n\n```\n$(cat $file)\n```", "stream": false}' | jq -r '.response')
comment="Ollama Code Review for \`$file\`:\n\n$review"
echo "$comment" >> ollama_review.txt
done
gitea pr comment ${{ gitea.event.pull_request.number }} --body "$(cat ollama_review.txt)"
shell: bash