feat(ai-pull-request): 以 opencode 分析 diff 自動產生並建立 Pull Request

This commit is contained in:
Jeffery
2026-06-26 11:42:05 +08:00
parent 5db3b328a2
commit d42ccd8b08
10 changed files with 887 additions and 27 deletions
+16 -6
View File
@@ -1,10 +1,20 @@
FROM alpine:latest
FROM node:20-bookworm-slim
# 安裝必要工具:git(操作分支/合併)、bash、ca-certificates、curl(安裝 opencode
RUN apt-get update \
&& apt-get install -y --no-install-recommends git bash ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
# 安裝 opencode CLI(用於分析 git diff 產生 PR 標題與描述)
RUN npm install -g opencode-ai
# 複製 Node.js 應用程式
COPY app/ /app/
# 應用程式無第三方相依套件,僅在有 package-lock 時安裝
RUN if [ -f /app/package-lock.json ]; then cd /app && npm ci --omit=dev; fi
# 安裝必要的工具
RUN apk add --no-cache --no-check-certificate bash
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]