feat: initial pi-review Docker action
Reusable Gitea/GitHub action that runs Pi coding agent for AI-powered code reviews on pull requests. - Docker image based on node:24-slim (112 packages) - Supports built-in providers (zai, anthropic, openai, deepseek, openrouter) and custom OpenAI-compatible endpoints - Generates git diff (excludes lockfiles/generated code by default) - Posts review as idempotent PR comment (updates existing on re-run) - Read-only tools only: agent investigates but never modifies code - 80KB default diff truncation to stay within LLM context windows - No curl/python3 dependency — uses Node.js for HTTP and JSON
This commit is contained in:
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM node:24-slim
|
||||
|
||||
# node:24-slim has ~88 packages (vs 413 in bookworm).
|
||||
# We only add git for diffing. curl and python3 are replaced by Node.js.
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Pi globally — baked into the image, no install at runtime
|
||||
RUN npm install -g @earendil-works/pi-coding-agent
|
||||
|
||||
# Copy action files into the image
|
||||
COPY prompts/default.md /action/prompts/default.md
|
||||
COPY scripts/review.sh /action/scripts/review.sh
|
||||
COPY entrypoint.sh /action/entrypoint.sh
|
||||
|
||||
RUN chmod +x /action/entrypoint.sh /action/scripts/review.sh
|
||||
|
||||
# Disable Pi's startup network calls
|
||||
ENV PI_OFFLINE=1
|
||||
|
||||
ENTRYPOINT ["/action/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user