fix: 改用 pull_request 事件并恢复 paths 过滤

This commit is contained in:
adminlove520
2026-03-19 23:32:37 +08:00
parent 0b8ecd0664
commit 54575e1ecf

View File

@@ -4,8 +4,17 @@
name: PR Review
on:
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.py'
- '**.md'
- 'README.md'
- 'requirements.txt'
- 'pyproject.toml'
- 'setup.cfg'
- '.github/workflows/**'
- '.github/scripts/**'
workflow_dispatch:
# 限制并发,避免同一 PR 多次触发时重复评论
@@ -241,7 +250,7 @@ jobs:
uses: actions/checkout@v5
- name: 🏷️ 添加标签
if: github.event_name == 'pull_request_target'
if: github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
@@ -312,7 +321,7 @@ jobs:
name: 💬 审查报告
runs-on: ubuntu-latest
needs: [security-check, auto-check, ai-review]
if: always() && github.event_name == 'pull_request_target' && needs.security-check.outputs.safe_to_run == 'true'
if: always() && github.event_name == 'pull_request' && needs.security-check.outputs.safe_to_run == 'true'
steps:
- name: 📥 检出代码