From 73787f6dfa7bef96b215f19a6374000ea9dcb727 Mon Sep 17 00:00:00 2001 From: Roberto Guagliardo Date: Mon, 2 Feb 2026 20:15:25 +0000 Subject: [PATCH] new action test --- .github/workflows/ai-review.yml | 53 ++++++++++----------------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index af1e723..21bf92b 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -8,21 +8,22 @@ jobs: review: runs-on: ubuntu-latest container: - image: python:3.11-bookworm + image: node:20-bookworm steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Show Python - run: python --version - - - name: Install system deps (git + curl) + - name: Install system deps + Python 3.11 run: | apt-get update - apt-get install -y --no-install-recommends git curl ca-certificates + apt-get install -y --no-install-recommends \ + git curl ca-certificates \ + python3.11 python3.11-venv python3-pip + ln -sf /usr/bin/python3.11 /usr/local/bin/python + python --version + node --version git --version - curl --version + + - name: Checkout + uses: actions/checkout@v4 - name: Create venv and install project run: | @@ -53,30 +54,8 @@ jobs: --head "${{ github.head_ref }}" \ --format json > review.json - - name: Post PR comment with findings - uses: actions/github-script@v6 - with: - script: | - const fs = require('fs'); - 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
Full JSON\n\n` + - '```json\n' + JSON.stringify(parsed, null, 2) + '\n```\n' + - '
'; - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: commentBody, - }); + # Temporarily remove github-script; it also needs GitHub env + - name: Show result + run: | + ls -la + head -c 2000 review.json || true