Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/bot-review-a.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,15 @@ jobs:
run: |
set -euo pipefail

# COMMENTED reviews are filtered out: GitHub's dismiss API returns 422
# ("Can not dismiss a commented pull request review") for them, which
# would fail this step and red-X the check. Only APPROVED and
# CHANGES_REQUESTED reviews can be dismissed — and those are also the
# only states that gate merging, so COMMENTED placeholders are noise
# the guard shouldn't act on. Observed on PR #2795 commit 0db188a5.
reviews=$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/reviews" --paginate \
| jq -c --arg sha "$HEAD_SHA" \
'[.[] | select(.user.login == "wheels-bot[bot]") | select(.commit_id == $sha) | select(.state != "DISMISSED")]')
'[.[] | select(.user.login == "wheels-bot[bot]") | select(.commit_id == $sha) | select(.state != "DISMISSED") | select(.state != "COMMENTED")]')

count=$(echo "$reviews" | jq 'length')
if [[ "$count" == "0" ]]; then
Expand Down
Loading