init re
This commit is contained in:
19
.github/workflows/ai-review.yml
vendored
19
.github/workflows/ai-review.yml
vendored
@@ -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\n<details><summary>Full JSON</summary>\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</details>';
|
||||
const commentBody = `${summary}\n\n<details><summary>Full JSON</summary>\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</details>';
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
|
||||
Reference in New Issue
Block a user