本文整理汇总了Java中org.kohsuke.github.GHPullRequest.getTitle方法的典型用法代码示例。如果您正苦于以下问题:Java GHPullRequest.getTitle方法的具体用法?Java GHPullRequest.getTitle怎么用?Java GHPullRequest.getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kohsuke.github.GHPullRequest
的用法示例。
在下文中一共展示了GHPullRequest.getTitle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GhprcPullRequest
import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
GhprcPullRequest(GHPullRequest pr, Ghprc helper, GhprcRepository repo) {
id = pr.getNumber();
try {
updated = pr.getUpdatedAt();
} catch (IOException e) {
e.printStackTrace();
updated = new Date();
}
head = pr.getHead().getSha();
title = pr.getTitle();
author = pr.getUser();
reponame = repo.getName();
target = pr.getBase().getRef();
source = pr.getHead().getRef();
url = pr.getHtmlUrl();
this.pr = pr;
obtainAuthorEmail(pr);
this.helper = helper;
this.repo = repo;
logger.log(Level.INFO, "Created Pull Request #{0} on {1} by {2} ({3}) updated at: {4} SHA: {5}",
new Object[] { id, reponame, author.getLogin(), authorEmail, updated, head }
);
}
示例2: updatePR
import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
private void updatePR(GHPullRequest pr, GHUser author) {
if (pr != null && isUpdated(pr)) {
logger.log(Level.INFO, "Pull request #{0} was updated on {1} at {2} by {3}", new Object[] { id, reponame, updated, author });
// the title could have been updated since the original PR was opened
title = pr.getTitle();
boolean newCommit = checkCommit(pr.getHead().getSha());
if (!newCommit) {
logger.log(Level.INFO, "Pull request #{0} was updated on repo {1} but there aren''t any new comments nor commits; "
+ "that may mean that commit status was updated.",
new Object[] { id, reponame }
);
}
}
}
示例3: GhprbPullRequest
import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
GhprbPullRequest(GHPullRequest pr, Ghprb helper, GhprbRepository repo) {
id = pr.getNumber();
updated = pr.getUpdatedAt();
head = pr.getHead().getSha();
title = pr.getTitle();
author = pr.getUser();
reponame = repo.getName();
target = pr.getBase().getRef();
obtainAuthorEmail(pr);
this.ml = helper;
this.repo = repo;
if(helper.isWhitelisted(author)){
accepted = true;
shouldRun = true;
}else{
logger.log(Level.INFO, "Author of #{0} {1} on {2} not in whitelist!", new Object[]{id, author.getLogin(), reponame});
repo.addComment(id, GhprbTrigger.getDscp().getRequestForTestingPhrase());
}
logger.log(Level.INFO, "Created pull request #{0} on {1} by {2} ({3}) updated at: {4} SHA: {5}", new Object[]{id, reponame, author.getLogin(), authorEmail, updated, head});
}
示例4: check
import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
public void check(GHPullRequest pr){
if(target == null) target = pr.getBase().getRef(); // If this instance was created before target was introduced (before v1.8), it can be null.
if(authorEmail == null) {
// If this instance was create before authorEmail was introduced (before v1.10), it can be null.
obtainAuthorEmail(pr);
}
if(isUpdated(pr)){
logger.log(Level.INFO, "Pull request builder: pr #{0} was updated on {1} at {2} by {3} ({4})", new Object[]{id, reponame, updated, author, authorEmail});
// the title could have been updated since the original PR was opened
title = pr.getTitle();
int commentsChecked = checkComments(pr);
boolean newCommit = checkCommit(pr.getHead().getSha());
if(!newCommit && commentsChecked == 0){
logger.log(Level.INFO, "Pull request was updated on repo {0} but there aren't any new comments nor commits - that may mean that commit status was updated.", reponame);
}
updated = pr.getUpdatedAt();
}
checkMergeable(pr);
tryBuild();
}
示例5: findPullRequest
import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
/**
* Lets try find a pull request for previous PRs
*/
protected GHPullRequest findPullRequest(CommandContext context, List<GHPullRequest> pullRequests) {
String prefix = context.createPullRequestTitlePrefix();
if (pullRequests != null) {
for (GHPullRequest pullRequest : pullRequests) {
String title = pullRequest.getTitle();
if (title != null && title.startsWith(prefix)) {
return pullRequest;
}
}
}
return null;
}
示例6: getChangeMessage
import org.kohsuke.github.GHPullRequest; //导入方法依赖的package包/类
private String getChangeMessage(GHPullRequest pr) {
return "GitHub Pull Request: "
+ pr.getUrl()
+ "\n\n"
+ pr.getTitle()
+ "\n\n"
+ pr.getBody().replaceAll("\n", "\n\n");
}