+
Skip to content

Adding missing field important to find branch in fork from same owner #2873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions example/commitpr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (
sourceRepo = flag.String("source-repo", "", "Name of repo to create the commit in.")
commitMessage = flag.String("commit-message", "", "Content of the commit message.")
commitBranch = flag.String("commit-branch", "", "Name of branch to create the commit in. If it does not already exists, it will be created using the `base-branch` parameter")
repoBranch = flag.String("repo-branch", "", "Name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization")
baseBranch = flag.String("base-branch", "master", "Name of branch to create the `commit-branch` from.")
prRepoOwner = flag.String("merge-repo-owner", "", "Name of the owner (user or org) of the repo to create the PR against. If not specified, the value of the `-source-owner` flag will be used.")
prRepo = flag.String("merge-repo", "", "Name of repo to create the PR against. If not specified, the value of the `-source-repo` flag will be used.")
Expand Down Expand Up @@ -164,6 +165,7 @@ func createPR() (err error) {
newPR := &github.NewPullRequest{
Title: prSubject,
Head: commitBranch,
HeadRepo: repoBranch,
Base: prBranch,
Body: prDescription,
MaintainerCanModify: github.Bool(true),
Expand Down
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions github/pulls.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str
type NewPullRequest struct {
Title *string `json:"title,omitempty"`
Head *string `json:"head,omitempty"`
HeadRepo *string `json:"head_repo,omitempty"`
Base *string `json:"base,omitempty"`
Body *string `json:"body,omitempty"`
Issue *int `json:"issue,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions github/pulls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ func TestNewPullRequest_Marshal(t *testing.T) {
u := &NewPullRequest{
Title: String("eh"),
Head: String("eh"),
HeadRepo: String("eh"),
Base: String("eh"),
Body: String("eh"),
Issue: Int(1),
Expand All @@ -943,6 +944,7 @@ func TestNewPullRequest_Marshal(t *testing.T) {
want := `{
"title": "eh",
"head": "eh",
"head_repo": "eh",
"base": "eh",
"body": "eh",
"issue": 1,
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载