Closed karup closed 7 years ago
From 18322a41853f7264aaf16f6c0c198f1a9d04cab8 Mon Sep 17 00:00:00 2001
From: Upkar Rai <upkarrai@gmail.com>
Date: Tue, 14 Feb 2017 11:49:53 -0800
Subject: [PATCH] Added Support for multiple build phrases
---
.../stashpullrequestbuilder/StashRepository.java | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepository.java b/src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepository.java
index f728957..b0ee52a 100644
--- a/src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepository.java
+++ b/src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepository.java
@@ -332,7 +332,7 @@ public class StashRepository {
if(isSkipBuild(content)) {
shouldBuild = false;
break;
- } if (isPhrasesContain(content, this.trigger.getCiBuildPhrases())) {
+ } if (isBuild(content)) {
shouldBuild = true;
break;
}
@@ -372,6 +372,19 @@ public class StashRepository {
return false;
}
+ private boolean isBuild(String pullRequestContentString) {
+ String buildPhrases = this.trigger.getCiBuildPhrases();
+ if (buildPhrases != null && !"".equals(buildPhrases)) {
+ String[] phrases = buildPhrases.split(",");
+ for(String phrase : phrases) {
+ if (isPhrasesContain(pullRequestContentString, phrase)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
private boolean isPhrasesContain(String text, String phrase) {
return text != null && text.toLowerCase().contains(phrase.trim().toLowerCase());
}
--
2.8.3.windows.1
Please add support for multiple comma separated build phrases. Patch is attached
0001-Added-Support-for-multiple-build-phrases.txt