fix(ci): trigger AI review on follow-up commits to PR

- Add `synchronize` event to trigger on new commits pushed to PR
- Add `reopened` event to trigger when PR is reopened
- Update documentation comments to reflect new behavior
- Keep cancel-in-progress to prevent stale reviews

Fixes issue where AI review only ran on PR creation, requiring
manual /review comment for subsequent commits.
This commit is contained in:
kaitranntt
2026-01-13 15:52:18 -05:00
parent 097b018532
commit a2a13fb16e
+6 -3
View File
@@ -3,15 +3,18 @@
# Posts as ccs-agy-reviewer[bot] via GitHub App
#
# Triggers:
# - Automatically when PR is first opened
# - Automatically when PR is opened, receives new commits, or is reopened
# - Manually via /review comment on PR
# - Manually via workflow_dispatch
#
# Note: Concurrency group cancels in-progress reviews when new commits arrive.
# This prevents wasting resources on outdated code reviews.
name: AI Code Review
on:
pull_request_target:
types: [opened] # Only on first open, not synchronize (avoids cancel-on-push)
types: [opened, synchronize, reopened]
issue_comment:
types: [created]
workflow_dispatch:
@@ -38,7 +41,7 @@ jobs:
id-token: write
# Conditions:
# - PR event: only on opened (not synchronize to avoid cancel-on-push)
# - PR event: on opened, synchronize (new commits), or reopened
# - Comment event: only if it's a PR, contains /review, and NOT from a bot
if: >
github.event_name == 'pull_request_target' ||