diff --git a/.gitea/ai-review/exclusions.json b/.gitea/ai-review/exclusions.json index 6dbc176..10800b7 100644 --- a/.gitea/ai-review/exclusions.json +++ b/.gitea/ai-review/exclusions.json @@ -168,5 +168,20 @@ "role": "Aria", "location": "entrypoint.sh", "suggestion": "entrypoint.sh 檔案結尾已有換行符號(0x0a),符合 POSIX 慣例" + }, + { + "role": "Maya", + "location": "app/main.js", + "suggestion": "main.js 整合測試需要真實 Gitea API、LLM API、git 操作,不適合單元測試。各模組已有獨立單元測試覆蓋" + }, + { + "role": "Maya", + "location": "app/comments.js", + "suggestion": "comments.js 的 buildTable 為簡單字串拼接,postComment 已透過 gitea.js mock 間接測試,補測試效益低" + }, + { + "role": "Maya", + "location": "app/roles.js", + "suggestion": "roles.js 依賴容器內固定路徑 /action/app/prompts/roles,單元測試環境無法存取,且邏輯為簡單 YAML 讀取與字串拼接" } ] diff --git a/Dockerfile b/Dockerfile index 3a5481d..ee322d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine +FROM alpine:3.20 RUN apk add --no-cache bash nodejs npm git \ && node --version \ @@ -7,10 +7,11 @@ RUN apk add --no-cache bash nodejs npm git \ WORKDIR /action +COPY app/package.json /action/app/ +RUN cd /action/app && npm install + COPY app/ /action/app/ COPY entrypoint.sh /entrypoint.sh - -RUN cd /action/app && npm install && \ - chmod +x /entrypoint.sh +RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/app/package.json b/app/package.json index 642c211..b010617 100644 --- a/app/package.json +++ b/app/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "type": "module", "scripts": { - "test": "node --test git.test.js config.test.js llm.test.js" + "test": "node --test *.test.js" }, "dependencies": { "axios": "^1.6.7",