From 250dd1e32709b89ebdeb1956377011a569c0cc83 Mon Sep 17 00:00:00 2001 From: james Date: Sun, 27 Jul 2025 23:45:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/test.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index c9900b4..a63e705 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -19,8 +19,15 @@ jobs: run: | # 提取 PR 编号(如 pull/14/head -> 14) PULLS_ID=$(git branch | grep -o 'pull/[0-9]\+' | cut -d'/' -f2) + if [ -z "$PULLS_ID" ]; then + echo "❌ 无法提取 PR 编号" + exit 1 + fi echo "PR ID: $PULLS_ID" + # 写入 GITHUB_ENV(可选,兼容旧脚本) echo "PULLS_ID=$PULLS_ID" >> $GITHUB_ENV + # 写入 outputs,供后续步骤使用 + echo "pr_number=$PULLS_ID" >> $GITHUB_OUTPUT - name: Run code review script env: @@ -30,8 +37,8 @@ jobs: IGNORED_PATHS: '["EdgeManager/vendor/**", "mes_in_sct/vendor/**", "mes_in_task/vendor/**", "webman/public/**", "webman/runtime/**", "webman/vendor/**"]' # 忽略检测目录 # === Gitea API 配置(传给 audit_code.sh)=== - API_URL: "http://119.91.43.128:3003/api/v1/repos/hui/SCTMES_V5/issues/$PULLS_ID/comments" - GITEA_TOKEN: $GITEA_TOKEN + API_URL: "http://119.91.43.128:3003/api/v1/repos/hui/SCTMES_V5/issues/${{ steps.get_pr_number.outputs.pr_number }}/comments" + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} SYSTEM_PROMPT: | 你是代码审核助手,我需要你审核代码后以JSON形式输出通过(passed)或者不通过(no-passed),只输出json不添加其他说明。