Skip to content

Commit b7d93e8

Browse files
committed
fix(review): count review rounds by commit, not review state
1 parent 380616e commit b7d93e8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎.github/workflows/claude-pr-review.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ jobs:
6565
PR_NUMBER=${{ github.event.pull_request.number }}
6666
REPO=${{ github.repository }}
6767
68+
# Count distinct commits already reviewed, never review state: the org ruleset
69+
# sets dismiss_stale_reviews_on_push, so a push flips every prior APPROVED to
70+
# DISMISSED. Inline comments each create their own COMMENTED review sharing the
71+
# round's commit_id, so unique commit_id == round count.
6872
CYCLE=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
69-
--paginate | jq -s '[.[][] | select(.user.type == "Bot" and (.state == "CHANGES_REQUESTED" or .state == "APPROVED"))] | length')
73+
--paginate | jq -s '[.[][] | select(.user.login == "claude[bot]") | .commit_id] | unique | length')
7074
echo "review_cycle=$((CYCLE + 1))" >> $GITHUB_OUTPUT
7175
7276
THREADS=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/comments" \

0 commit comments

Comments
 (0)