Skip to content

Commit f44eedf

Browse files
ci(api-review-gate): skip review-bot comment events
The gate re-ran on every pull_request_review event, including the plain `commented` reviews that CodeRabbit and dosubot post — each rebuilding the detector for ~30s and getting cancelled by the concurrency group, piling up runs on the checks tab. A `commented` review cannot change the gate's verdict (it counts only APPROVED, dropped by changes_requested/dismissed). Guard the job so review events re-run it only when the review is approved, changes_requested, or dismissed. Pushes (pull_request) are unaffected, so the required-check status invariant is preserved. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 99a28d8 commit f44eedf

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎.github/workflows/api-review-gate.yaml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ on:
1414
pull_request:
1515
types: [opened, synchronize, reopened]
1616
# Re-evaluate when a review is submitted or dismissed so an approval by an
17-
# API owner flips the check from failing to passing without a new push.
17+
# API owner flips the check from failing to passing without a new push. The
18+
# job-level `if` below drops the review-bot noise (plain `commented` reviews);
19+
# only reviews that can move the gate — approved, changes_requested, dismissed
20+
# — actually re-run it.
1821
pull_request_review:
1922
types: [submitted, dismissed]
2023

@@ -29,6 +32,15 @@ permissions:
2932
jobs:
3033
api-review-gate:
3134
name: Require API owner review for sizeable API changes
35+
# A push (pull_request) always evaluates the gate — that run is what branch
36+
# protection gates on. A review event only re-runs it when the review can
37+
# change the verdict: an approval can flip fail->pass, a dismissal or a
38+
# changes_requested can flip pass->fail. Plain `commented` reviews — all the
39+
# review bots (CodeRabbit, dosubot) ever post — cannot, so they skip here
40+
# instead of rebuilding the detector on every bot comment.
41+
if: >-
42+
github.event_name != 'pull_request_review' ||
43+
github.event.review.state != 'commented'
3244
runs-on: ubuntu-22.04
3345
env:
3446
# Space-separated GitHub logins allowed to satisfy the gate. Edit here to

0 commit comments

Comments
 (0)