generated from ztimson/template
Fixed review?
This commit is contained in:
9
.github/workflows/review.yml
vendored
9
.github/workflows/review.yml
vendored
@@ -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"
|
||||
|
||||
@@ -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"]
|
||||
|
||||
10
README.md
10
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"
|
||||
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
@@ -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}};
|
||||
|
||||
Reference in New Issue
Block a user