From 59c78f08e0b4b5440af687f4a05a71e2d15ce1af Mon Sep 17 00:00:00 2001 From: adminlove520 <791751568@qq.com> Date: Fri, 20 Mar 2026 12:28:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20fork=20PR=20=E5=AE=8C=E5=85=A8=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=20AI=20=E5=AE=A1=E6=9F=A5=E5=92=8C=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-review.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index ea3db80..86bcb53 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -176,16 +176,18 @@ jobs: STATS=$(git diff --stat origin/$BASE_REF...HEAD 2>/dev/null | tail -1) echo "$STATS" >> $GITHUB_STEP_SUMMARY - # ==================== AI 代码审查(依赖静态检查通过)==================== + # ==================== AI 代码审查(仅内部 PR)==================== ai-review: name: 🤖 AI 代码审查 runs-on: ubuntu-latest needs: [security-check, auto-check] + # fork PR 没有 secrets,跳过 AI 审查 if: | needs.security-check.outputs.safe_to_run == 'true' && needs.auto-check.result == 'success' && needs.auto-check.outputs.has_reviewable_changes == 'true' && - vars.ENABLE_AI_REVIEW != 'false' + vars.ENABLE_AI_REVIEW != 'false' && + github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name steps: # 先检出主分支(获取最新的 .github/scripts) @@ -323,7 +325,7 @@ jobs: name: 💬 审查报告 runs-on: ubuntu-latest needs: [security-check, auto-check] - # fork PR 没有评论权限,跳过评论步骤 + # 仅内部 PR 才评论 if: always() && github.event_name == 'pull_request' && needs.security-check.outputs.safe_to_run == 'true' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name steps: