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 to dev from cancelling in-progress reviews.
This commit is contained in:
kaitranntt
2026-01-08 11:10:55 -05:00
parent 37a65e3a32
commit 6f65697d74
+5 -4
View File
@@ -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' ||