|
58 | 58 | required: false |
59 | 59 | type: boolean |
60 | 60 | default: false |
| 61 | + auto_review_on_push: |
| 62 | + description: 'When auto_review is enabled, also run on pull_request.synchronize events (default false)' |
| 63 | + required: false |
| 64 | + type: boolean |
| 65 | + default: false |
61 | 66 | goal: |
62 | 67 | description: 'Explicit execution goal. When set, bypasses default goal generation.' |
63 | 68 | required: false |
@@ -500,12 +505,24 @@ jobs: |
500 | 505 | fi |
501 | 506 | fi |
502 | 507 |
|
503 | | - # Auto-review: run only for pull_request / pull_request_review events. |
504 | | - # Do NOT auto-run on issue_comment for PRs (avoids bot comment storms). |
| 508 | + # Auto-review runs only on selected PR events. |
| 509 | + # Default behavior avoids re-reviewing every push unless explicitly enabled. |
505 | 510 | if [ "$SHOULD_RUN" != 'true' ] && [ "$INPUT_AUTO_REVIEW" = 'true' ] && [ "$IS_PR" = 'true' ]; then |
506 | | - if [ "$EVENT_NAME" = 'pull_request' ] || [ "$EVENT_NAME" = 'pull_request_review' ]; then |
507 | | - SHOULD_RUN='true' |
508 | | - REASON="Auto-review enabled (${EVENT_NAME})" |
| 511 | + if [ "$EVENT_NAME" = 'pull_request' ]; then |
| 512 | + case "$EVENT_ACTION" in |
| 513 | + opened|reopened|ready_for_review) |
| 514 | + SHOULD_RUN='true' |
| 515 | + REASON="Auto-review enabled for pull_request.${EVENT_ACTION}" |
| 516 | + ;; |
| 517 | + synchronize) |
| 518 | + if [ "$INPUT_AUTO_REVIEW_ON_PUSH" = 'true' ]; then |
| 519 | + SHOULD_RUN='true' |
| 520 | + REASON='Auto-review enabled for pull_request.synchronize' |
| 521 | + else |
| 522 | + REASON='Auto-review skipped for pull_request.synchronize; enable auto_review_on_push to review every push' |
| 523 | + fi |
| 524 | + ;; |
| 525 | + esac |
509 | 526 | fi |
510 | 527 | fi |
511 | 528 |
|
@@ -555,6 +572,7 @@ jobs: |
555 | 572 | INPUT_REVIEW_BODY: ${{ inputs.review_body }} |
556 | 573 | EVENT_REVIEW_BODY: ${{ github.event.review.body }} |
557 | 574 | INPUT_AUTO_REVIEW: ${{ inputs.auto_review }} |
| 575 | + INPUT_AUTO_REVIEW_ON_PUSH: ${{ inputs.auto_review_on_push }} |
558 | 576 |
|
559 | 577 | - name: Gate summary |
560 | 578 | if: always() |
|
0 commit comments