From 8d552fef41d54f974f6777f07e0a90b69449caa5 Mon Sep 17 00:00:00 2001 From: beppeb Date: Tue, 19 Aug 2025 08:57:25 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/code-revi?= =?UTF-8?q?ew.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/code-review.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/code-review.yml b/.gitea/workflows/code-review.yml index d7996f4..c325b97 100644 --- a/.gitea/workflows/code-review.yml +++ b/.gitea/workflows/code-review.yml @@ -6,16 +6,18 @@ on: jobs: review: runs-on: ubuntu-latest - if: startsWith(github.event.comment.body, 'openai') || github.event.comment.body == 'openai' + if: github.event.issue.pull_request && (startsWith(github.event.comment.body, 'openai') || github.event.comment.body == 'openai') + env: + ACTIONS_STEP_DEBUG: 'true' # 可选,便于查看调试日志 steps: - name: OpenAI Code Review uses: ingress-it-solutions/gitea-code-review-action@v0.1 with: SOURCE_AT: gitea - GITHUB_BASE_URL: https://devstar.cn - PROGRAMMING_LANGUAGE: auto + GITHUB_BASE_URL: https://devstar.cn # 若有子路径/端口,请改成真实根地址 + PROGRAMMING_LANGUAGE: 'JavaScript' # 避免使用 auto FULL_REVIEW_COMMENT: openai REVIEW_COMMENT_PREFIX: 'openai:' MAX_CODE_LENGTH: 6000 OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # 需为 Gitea PAT,具备对 PR/Issue 评论权限 \ No newline at end of file