Original error info from GitHub API (formatted for readability):
$ curl -H "Authorization: token XXXXXXXX" -X POST -d '{"commit_id": "ffffffffff"}' https://api.github.com/repos/wataash/sandbox/pulls/1/reviews
{
"message": "Unprocessable Entity",
"errors": [
"Variable commitOID of type GitObjectID was provided invalid value"
],
"documentation_url": "https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review"
}
indicates the commit id ffffffffff doesn't exist.
Same one via go-github:
ctx := context.Background()
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: "XXXXXXXX"})
tc := oauth2.NewClient(ctx, ts)
client := github.NewClient(tc)
nonExistCommitID := "ffffffffff"
review := github.PullRequestReviewRequest{CommitID: &nonExistCommitID}
_, _, err := client.PullRequests.CreateReview(ctx, "wataash", "sandbox", 1, &review)
_, _ = fmt.Printf("%+v\n", err)
prints:
POST https://api.github.com/repos/wataash/sandbox/pulls/1/reviews: 422 Unprocessable Entity [{Resource: Field: Code: Message:}]
which lacks the error details but shows unrelated fields.
Original error info from GitHub API (formatted for readability):
indicates the commit id
ffffffffffdoesn't exist.Same one via go-github:
prints:
which lacks the error details but shows unrelated fields.