java - 使用 github-java sdk 添加审阅者到拉取请求
问题描述
我正在尝试使用https://github.com/eclipse/egit-github/tree/master/org.eclipse.egit.github.core
创建拉取请求,但找不到向拉取请求添加评论的方法。V3 Github API 支持添加此处提到的审阅者,https://developer.github.com/v3/pulls/review_requests/#create-a-review-request。我正在尝试按如下方式创建拉取请求。
private void createPullRequest(
String repositoryName,
String repositoryOwner,
String pullRequestTitle,
String pullRequestBody,
String branchSource,
String branchDestination
) throws IOException {
logger.info("starting to create pull request");
var gitHubClient = new GitHubClient();
gitHubClient.setCredentials("x", "y");
var repositoryService = new RepositoryService(gitHubClient);
var repository = repositoryService.getRepository(repositoryOwner, repositoryName);
var pullRequestService = new PullRequestService(gitHubClient);
var pullRequest = new PullRequest();
pullRequest.setTitle(pullRequestTitle);
pullRequest.setBody(pullRequestBody);
pullRequest.setHead(
new PullRequestMarker().setRef(branchSource).setLabel(branchSource)
);
pullRequest.setBase(
new PullRequestMarker().setRef(branchDestination).setLabel(branchDestination)
);
logger.info("Finally starting to push PR");
pullRequestService.createPullRequest(repository, pullRequest);
logger.info("PR should be created now");
}
从它说的文档来看,它支持 100% 的 Github V3 API。但是我无法在代码和在线中找到任何用于添加审阅者的参考。
谢谢!
解决方案
推荐阅读
- mysql - SQL 创建视图
- vpn - 如何从 OCI(Oracle 云基础设施)计算实例连接到本地 OpenVPN 服务器?
- google-sheets - 谷歌表格,将“2020-January”转换为“2020-01”等等
- uwp - UWP 在课堂上打开新窗口
- python - 将鼠标悬停在已保存的 matplotlib 图上时进行注释
- authentication - Power Apps - 使用 Azure Active Directory 进行 OAUTH 2 身份验证
- amazon-web-services - 在本地开发 Glue ETL 脚本 - java.lang.IllegalStateException:连接池关闭
- react-native - Axios React 上传 jpg
- r - 如何根据 r 中另一个数据帧的匹配 ID 更新数据帧中的新列
- c - 在 ESP IDF 编译器中包含头文件