mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 20:15:40 +00:00
fix(ci): prevent self-cancelling AI review workflow
Root cause: Bot progress comments triggered issue_comment events, which created new workflow runs with the same concurrency group, causing cancel-in-progress to kill the original review. Fixes: 1. Add event_name to concurrency group (prevents cross-event cancellation) 2. Explicit filter for ccs-agy-reviewer[bot] comments (belt-and-suspenders) Closes race condition causing 25+ cancelled AI review runs.
This commit is contained in:
1 parent
805ff64a7e
commit
120aca466d
1 file changed
+7
-4
@@ -21,9 +21,10 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
# Cancel in-progress runs for same PR (safe now since auto-trigger is only on opened)
|
# Cancel in-progress runs for same PR + event type (prevents self-cancellation from bot comments)
|
||||||
|
# Each event type gets its own concurrency group to prevent cross-event cancellation
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ai-review-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
group: ai-review-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -38,14 +39,16 @@ jobs:
|
|||||||
|
|
||||||
# Conditions:
|
# Conditions:
|
||||||
# - PR event: only on opened (not synchronize to avoid cancel-on-push)
|
# - PR event: only on opened (not synchronize to avoid cancel-on-push)
|
||||||
# - Comment event: only if it's a PR, contains /review, and NOT from a bot
|
# - Comment event: only if it's a PR, contains /review, NOT from a bot, and NOT from our review bot
|
||||||
|
# The explicit bot name check prevents self-triggering from progress comments
|
||||||
if: >
|
if: >
|
||||||
github.event_name == 'pull_request_target' ||
|
github.event_name == 'pull_request_target' ||
|
||||||
github.event_name == 'workflow_dispatch' ||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
(github.event_name == 'issue_comment' &&
|
(github.event_name == 'issue_comment' &&
|
||||||
github.event.issue.pull_request &&
|
github.event.issue.pull_request &&
|
||||||
contains(github.event.comment.body, '/review') &&
|
contains(github.event.comment.body, '/review') &&
|
||||||
github.event.comment.user.type != 'Bot')
|
github.event.comment.user.type != 'Bot' &&
|
||||||
|
github.event.comment.user.login != 'ccs-agy-reviewer[bot]')
|
||||||
|
|
||||||
# CLIProxy environment for model routing
|
# CLIProxy environment for model routing
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in new issue
Block a user