Fixed review?
Some checks failed
Build and publish / Build Container (push) Successful in 49s
Code review / review (pull_request) Failing after 3s

This commit is contained in:
2025-12-27 20:48:20 -05:00
parent 1b3232b10c
commit bee0029469
4 changed files with 11 additions and 16 deletions

View File

@@ -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"

View File

@@ -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"]

View File

@@ -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"
```
</details>

View File

@@ -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}};