This repository was archived by the owner on Jan 30, 2025. It is now read-only.
Fixed Some Stuff 🧪🛠️ #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🔍 Code Check | |
on: | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
ollama_review: | |
runs-on: ubuntu-latest | |
name: 🦙 Ollama Code Review Job | |
steps: | |
- name: ⬇️ Checkout Pull Request | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: ⬇️ Install Ollama | |
run: | | |
curl -fsSL https://ollama.com/install.sh | bash | |
ollama | |
ollama pull codegemma | |
- name: 🔍 Review Changed Files | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "" > Review.txt | |
for file in $(git diff --name-only origin/main); do | |
if [ -f "$file" ]; then | |
cat "$file" | |
modified_file_review=$(curl http://127.0.0.1:11434/api/generate -d '{"model": "codegemma", "prompt": "Review the following code: $(cat $file)", "stream": false}' | jq -r '.response') | |
Comment="Ollama Code Review for \`$file\`: $modified_file_review" | |
echo "$Comment" >> Review.txt | |
echo "$Comment" | |
else | |
echo "File $file does not exist." | |
fi | |
done | |
shell: bash |