How to Create Pull Request / Commit #1152
-
|
I would like to know how to make a pull request or commit, with a String of content as comment. Is that possible or am i not quite understanding the possibility's of this API? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
A pull request and a commit are quite different from each other, so it looks like you have two separate questions. I'm addressing the pull request question below - Given you have an existing GitHub repository with a base branch GHRepository repo = gitHub.getOrganization("AteroConfigs").getRepository("repo-name-here");
String prTitle = "Adding new feature ABC";
String prDescriptionInMarkdown = ## PR Description goes here"
GHPullRequest pullRequest = repo.createPullRequest(prTitle, "new-feature", "main", prDescriptionInMarkdown);If you want to add additional comments to the pull request, you can do so with the pullRequest.comment("My new comment"); |
Beta Was this translation helpful? Give feedback.
A pull request and a commit are quite different from each other, so it looks like you have two separate questions. I'm addressing the pull request question below -
Given you have an existing GitHub repository with a base branch
mainand anew-featurebranch with commits, you can create a pull request to merge yournew-featurebranch into yourmainbranch with the following code -If you w…