Skip to content

Commit

Permalink
Merge pull request #15 from lwalkera/gh-skip-phrase
Browse files Browse the repository at this point in the history
Make skip phrase check comments as well as titles
  • Loading branch information
nemccarthy committed Sep 22, 2016
2 parents a38c369 + 2576c4d commit bf42717
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -319,7 +319,10 @@ private boolean isBuildTarget(StashPullRequestResponseValue pullRequest) {
}
}

if (isPhrasesContain(content, this.trigger.getCiBuildPhrases())) {
if(isSkipBuild(content)) {
shouldBuild = false;
break;
} if (isPhrasesContain(content, this.trigger.getCiBuildPhrases())) {
shouldBuild = true;
break;
}
Expand All @@ -346,12 +349,12 @@ private boolean isForTargetBranch(StashPullRequestResponseValue pullRequest) {
return true;
}

private boolean isSkipBuild(String pullRequestTitle) {
private boolean isSkipBuild(String pullRequestContentString) {
String skipPhrases = this.trigger.getCiSkipPhrases();
if (skipPhrases != null && !"".equals(skipPhrases)) {
String[] phrases = skipPhrases.split(",");
for(String phrase : phrases) {
if (isPhrasesContain(pullRequestTitle, phrase)) {
if (isPhrasesContain(pullRequestContentString, phrase)) {
return true;
}
}
Expand Down

0 comments on commit bf42717

Please sign in to comment.