diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml
index 1b53495..6fa0a70 100644
--- a/.github/workflows/ai-review.yml
+++ b/.github/workflows/ai-review.yml
@@ -13,7 +13,7 @@ jobs:
ports:
- 11434:11434
options: >-
- --health-cmd='curl -sSf http://192.168.1.92/:11434/ || exit 1' --health-interval=10s --health-timeout=5s --health-retries=12
+ --health-cmd="curl -sSf http://192.168.1.92:11434/ || exit 1" --health-interval=10s --health-timeout=5s --health-retries=12
steps:
- name: Checkout
@@ -33,7 +33,6 @@ jobs:
- name: Wait for Ollama
run: |
- # Wait for Ollama service to be ready
for i in $(seq 1 30); do
if curl -sSf http://192.168.1.92:11434/ >/dev/null 2>&1; then
echo "ollama ready" && break
@@ -44,7 +43,6 @@ jobs:
- name: (Optional) Pull model into Ollama
run: |
. venv/bin/activate
- # ignore errors if ollama CLI not available in container; it's optional
ollama pull qwen2.5-coder:7b || true
- name: Run ai-reviewer
@@ -59,18 +57,17 @@ jobs:
with:
script: |
const fs = require('fs');
- const body = fs.readFileSync('review.json','utf8');
+ let body = '{}';
+ try {
+ body = fs.readFileSync('review.json', 'utf8');
+ } catch (e) {
+ body = JSON.stringify({ error: 'missing-review', message: String(e) });
+ }
let parsed = {};
try { parsed = JSON.parse(body); } catch (e) { parsed = { error: 'invalid-json', raw: body }; }
const findings = parsed.findings || [];
const summary = findings.length === 0 ? 'AI Reviewer: no findings.' : `AI Reviewer found ${findings.length} findings.`;
- const commentBody = `${summary}\n\nFull JSON
\n\n\n\n\
-\
-\n\n\n\\n\\n\n\
-\n\
-\n\n\n\n\n\n\n\n\n\
-\n\`
-\n\n` + '```json\n' + JSON.stringify(parsed, null, 2) + '\n```\n ';
+ const commentBody = `${summary}\n\nFull JSON
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n` + '```json\n' + JSON.stringify(parsed, null, 2) + '\n```\n ';
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,