mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 20:17:45 +00:00
fix(ci): only auto-review on PR opened, not synchronize
Removes synchronize trigger to prevent cancel-on-push issue. Reviews now trigger: - Auto: when PR is first opened - Manual: via /review comment - Manual: via workflow_dispatch This prevents pushes from cancelling in-progress reviews. Must be on main for pull_request_target to use updated workflow.
This commit is contained in:
@@ -3,14 +3,15 @@
|
||||
# Posts as ccs-agy-reviewer[bot] via GitHub App
|
||||
#
|
||||
# Triggers:
|
||||
# - Automatically on PR open/update
|
||||
# - Automatically when PR is first opened
|
||||
# - Manually via /review comment on PR
|
||||
# - Manually via workflow_dispatch
|
||||
|
||||
name: AI Code Review
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened]
|
||||
types: [opened] # Only on first open, not synchronize (avoids cancel-on-push)
|
||||
issue_comment:
|
||||
types: [created]
|
||||
workflow_dispatch:
|
||||
@@ -20,7 +21,7 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# Cancel in-progress runs for same PR
|
||||
# Cancel in-progress runs for same PR (safe now since auto-trigger is only on opened)
|
||||
concurrency:
|
||||
group: ai-review-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
||||
cancel-in-progress: true
|
||||
@@ -36,7 +37,7 @@ jobs:
|
||||
id-token: write
|
||||
|
||||
# Conditions:
|
||||
# - PR event: always run (pull_request_target has secrets access for forks)
|
||||
# - PR event: only on opened (not synchronize to avoid cancel-on-push)
|
||||
# - Comment event: only if it's a PR and contains /review
|
||||
if: >
|
||||
github.event_name == 'pull_request_target' ||
|
||||
|
||||
Reference in New Issue
Block a user