From f6299f14b06c6ee438e2bd640f17d03393673fc7 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Mon, 15 Jul 2024 12:51:58 -0700 Subject: [PATCH] github: add doc for NewPullRequest I recently mixed up "Head" and "Base" and the error message was not clear. Add some guidance to help people avoid making the same mistake. This is copied word for word from the existing Github docs. --- github/pulls.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/github/pulls.go b/github/pulls.go index 80df9fa688a..b668502691e 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -250,9 +250,16 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str // NewPullRequest represents a new pull request to be created. type NewPullRequest struct { - Title *string `json:"title,omitempty"` - Head *string `json:"head,omitempty"` - HeadRepo *string `json:"head_repo,omitempty"` + Title *string `json:"title,omitempty"` + // The name of the branch where your changes are implemented. For + // cross-repository pull requests in the same network, namespace head with + // a user like this: username:branch. + Head *string `json:"head,omitempty"` + HeadRepo *string `json:"head_repo,omitempty"` + // The name of the branch you want the changes pulled into. This should be + // an existing branch on the current repository. You cannot submit a pull + // request to one repository that requests a merge to a base of another + // repository. Base *string `json:"base,omitempty"` Body *string `json:"body,omitempty"` Issue *int `json:"issue,omitempty"`