diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java index 918cdbf2c..56d976825 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java @@ -32,6 +32,7 @@ import java.io.UnsupportedEncodingException; import java.net.URL; import java.net.URLEncoder; +import java.util.Arrays; import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; @@ -52,6 +53,9 @@ public class GhprbRepository implements Saveable { private static final transient EnumSet HOOK_EVENTS = EnumSet.of(GHEvent.ISSUE_COMMENT, GHEvent.PULL_REQUEST); + private static final List ALLOWED_ACTIONS = Arrays.asList("edited", "labeled", "opened", "reopened", "synchronize", + "unlabeled"); + private final String reponame; private final Map pullRequests; @@ -389,7 +393,7 @@ void onPullRequestHook(PullRequest pr) throws IOException { doSave = true; } else if (!trigger.isActive()) { LOGGER.log(Level.FINE, "Not processing Pull request since the build is disabled"); - } else if ("edited".equals(action) || "opened".equals(action) || "reopened".equals(action) || "synchronize".equals(action)) { + } else if (ALLOWED_ACTIONS.contains(action)) { GhprbPullRequest pull = getPullRequest(ghpr, number); pull.check(ghpr, true); doSave = true;