Skip to content

Commit fb4bbb8

Browse files
authored
workflows: tighten auto-review triggers (#748)
1 parent 0f234ba commit fb4bbb8

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.github/workflows/holon-solve.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ on:
5858
required: false
5959
type: boolean
6060
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
6166
goal:
6267
description: 'Explicit execution goal. When set, bypasses default goal generation.'
6368
required: false
@@ -500,12 +505,24 @@ jobs:
500505
fi
501506
fi
502507
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.
505510
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
509526
fi
510527
fi
511528
@@ -555,6 +572,7 @@ jobs:
555572
INPUT_REVIEW_BODY: ${{ inputs.review_body }}
556573
EVENT_REVIEW_BODY: ${{ github.event.review.body }}
557574
INPUT_AUTO_REVIEW: ${{ inputs.auto_review }}
575+
INPUT_AUTO_REVIEW_ON_PUSH: ${{ inputs.auto_review_on_push }}
558576

559577
- name: Gate summary
560578
if: always()

.github/workflows/holon-trigger.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
contents: write
1313
issues: write
1414
pull-requests: write
15+
packages: read
1516
id-token: write
1617

1718
jobs:
@@ -26,6 +27,7 @@ jobs:
2627
comment_id: ${{ github.event.comment.id || 0 }}
2728
review_id: ${{ github.event.review.id || 0 }}
2829
auto_review: ${{ fromJSON(vars.HOLON_AUTO_REVIEW || 'false') }}
30+
auto_review_on_push: ${{ fromJSON(vars.HOLON_AUTO_REVIEW_ON_PUSH || 'false') }}
2931
# Optional: override goal for all runs.
3032
# goal: 'Review this PR and publish findings.'
3133

examples/workflows/holon-trigger.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
contents: write
1313
issues: write
1414
pull-requests: write
15+
packages: read
1516
id-token: write
1617

1718
jobs:
@@ -24,9 +25,12 @@ jobs:
2425
assignee_login: ${{ github.event.assignee.login || '' }}
2526
comment_id: ${{ github.event.comment.id || 0 }}
2627
review_id: ${{ github.event.review.id || 0 }}
27-
# Optional: enable auto-review for every PR when true (default false)
28+
# Optional: enable auto-review for PR open/reopen/ready_for_review events.
2829
# Configure repo variable HOLON_AUTO_REVIEW=true to enable.
2930
auto_review: ${{ fromJSON(vars.HOLON_AUTO_REVIEW || 'false') }}
31+
# Optional: also auto-review on every new push to the PR.
32+
# Configure repo variable HOLON_AUTO_REVIEW_ON_PUSH=true to enable.
33+
auto_review_on_push: ${{ fromJSON(vars.HOLON_AUTO_REVIEW_ON_PUSH || 'false') }}
3034
# Optional: override goal for all runs. Empty = Holon defaults by target type.
3135
# goal: 'Review this PR and publish findings.'
3236
# Optional: Specify custom runner labels.

0 commit comments

Comments
 (0)