mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 16:19:27 +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 to dev from cancelling in-progress reviews.
This commit is contained in:
@@ -3,14 +3,15 @@
|
|||||||
# Posts as ccs-agy-reviewer[bot] via GitHub App
|
# Posts as ccs-agy-reviewer[bot] via GitHub App
|
||||||
#
|
#
|
||||||
# Triggers:
|
# Triggers:
|
||||||
# - Automatically on PR open/update
|
# - Automatically when PR is first opened
|
||||||
# - Manually via /review comment on PR
|
# - Manually via /review comment on PR
|
||||||
|
# - Manually via workflow_dispatch
|
||||||
|
|
||||||
name: AI Code Review
|
name: AI Code Review
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened] # Only on first open, not synchronize (avoids cancel-on-push)
|
||||||
issue_comment:
|
issue_comment:
|
||||||
types: [created]
|
types: [created]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -20,7 +21,7 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
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:
|
concurrency:
|
||||||
group: ai-review-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
group: ai-review-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@@ -36,7 +37,7 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
# Conditions:
|
# 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
|
# - Comment event: only if it's a PR and contains /review
|
||||||
if: >
|
if: >
|
||||||
github.event_name == 'pull_request_target' ||
|
github.event_name == 'pull_request_target' ||
|
||||||
|
|||||||
Reference in New Issue
Block a user