Closed
Description
Steps to reproduce:
prs, _, _ := client.PullRequests.List(ctx, owner, repo, nil)
pull := prs[0]
pull.State = github.String("closed")
// pull.Base = nil <- if this line is added, error does not appear
_, _, err := client.PullRequests.Edit(ctx, owner, repo, *pull.Number, pull)
require.NoError(t, err)
This code successfully closes the PR, but results in error:
received unexpected error:
PATCH https://api.github.com/repos/owner/repo/pulls/1: 422 Validation Failed [{Resource:PullRequest Field:base Code:invalid Message:Cannot change the base branch of a closed pull request.}]
Is that expected behaviour? Do I use the library correctly?
Metadata
Metadata
Assignees
Labels
No labels