From bee0029469316c99b985af55276d31fe73136ea9 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sat, 27 Dec 2025 20:48:20 -0500 Subject: [PATCH] Fixed review? --- .github/workflows/review.yml | 9 +++------ Dockerfile | 6 +++--- README.md | 10 ++++------ src/review.mjs | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 2aa1191..554d622 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -16,11 +16,8 @@ jobs: - name: Run AI Review run: | - REGISTRY="$(echo "${{github.server_url}}" | sed -E 's|https?://||')" - docker login -u "${{github.repository_owner}}" -p "${{secrets.DEPLOY_TOKEN}}" "$REGISTRY" - docker pull "$REGISTRY/ztimson/ai-reviewer:test" - docker run --rm \ - -v $(pwd):/github/workspace \ + docker pull "git.zakscode.com/ztimson/ai-reviewer:test" + docker run --rm -v $(pwd):/app \ -e AI_HOST=anthropic \ -e AI_MODEL=claude-sonnet-4-5 \ -e AI_TOKEN="${{ secrets.ANTHROPIC_TOKEN }}" \ @@ -30,4 +27,4 @@ jobs: -e GIT_TOKEN="${{ secrets.ASSISTANT_TOKEN }}" \ -e GIT_BRANCH="origin/${{ github.event.pull_request.base.ref }}" \ -e PULL_REQUEST="${{ github.event.pull_request.number }}" \ - "$REGISTRY/ztimson/ai-reviewer:test" + "git.zakscode.com/ztimson/ai-reviewer:test" diff --git a/Dockerfile b/Dockerfile index e630163..0e56696 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:22 COPY . /ai -RUN cd /ai && npm ci && mkdir -p /github/workspace +RUN cd /ai && npm ci && mkdir -p /app -WORKDIR /github/workspace -ENTRYPOINT ["node", "/ai/src/review.mjs", "/github/workspace"] +WORKDIR /app +ENTRYPOINT ["node", "/ai/src/review.mjs", "/app"] diff --git a/README.md b/README.md index 283a78c..62dc5e7 100644 --- a/README.md +++ b/README.md @@ -74,11 +74,8 @@ jobs: - name: Run AI Review run: | - REGISTRY="$(echo "${{github.server_url}}" | sed -E 's|https?://||')" - docker login -u "${{github.repository_owner}}" -p "${{secrets.DEPLOY_TOKEN}}" "$REGISTRY" - docker pull "$REGISTRY/ztimson/ai-reviewer:test" - docker run --rm \ - -v $(pwd):/github/workspace \ + docker pull "git.zakscode.com/ztimson/ai-reviewer:test" + docker run --rm -v $(pwd):/app \ -e AI_HOST=anthropic \ -e AI_MODEL=claude-sonnet-4-5 \ -e AI_TOKEN="${{ secrets.ANTHROPIC_TOKEN }}" \ @@ -88,7 +85,8 @@ jobs: -e GIT_TOKEN="${{ secrets.ASSISTANT_TOKEN }}" \ -e GIT_BRANCH="origin/${{ github.event.pull_request.base.ref }}" \ -e PULL_REQUEST="${{ github.event.pull_request.number }}" \ - "$REGISTRY/ztimson/ai-reviewer:test" + "git.zakscode.com/ztimson/ai-reviewer:test" + ``` diff --git a/src/review.mjs b/src/review.mjs index e98a248..e01f605 100644 --- a/src/review.mjs +++ b/src/review.mjs @@ -20,11 +20,11 @@ dotenv.config({path: '.env.local', override: true}); model = process.env['AI_MODEL'], token = process.env['AI_TOKEN']; + console.log(`Reviewing: ${root}\n`); const comments = []; const commit = await $`cd ${root} && git log -1 --pretty=format:%H`; const gitDiff = await $`cd ${root} && git diff ${branch}`; - console.log(`Reviewing: ${root}\n`); let options = {ollama: {model, host}}; if(host === 'anthropic') options = {anthropic: {model, token}};