fix(github): readable API errors, normalised webhook review states, no REQUEST_CHANGES on the token's own PR

Errors say what GitHub refused in its own words instead of the request URL
and an empty field list. Webhook review states arrive lower-case and were
never normalised, so a webhook-delivered change request did not read as one.
A review the token would post as REQUEST_CHANGES on its own pull request
comments instead, which GitHub accepts. Secondary rate limits wait up to two
minutes and retry.
This commit is contained in:
sam committed 2026-10-25 18:11:39 +11:00
1 parent ed82b6811e
commit 45bd6c47ee
8 files changed
+196 -44

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ func (c *GitHubClient) ParseWebhook(headers map[string]string, body []byte) (for
PRNumber: e.GetPullRequest().GetNumber(),
ReviewID: review.GetID(),
Author: review.GetUser().GetLogin(),
State: review.GetState(),
State: normalizeReviewState(review.GetState()),
Body: review.GetBody(),
}}, nil
case *github.PullRequestReviewCommentEvent: