Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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;
Expand All @@ -53,6 +54,9 @@ public class GhprbRepository implements Saveable {

private static final transient EnumSet<GHEvent> HOOK_EVENTS = EnumSet.of(GHEvent.ISSUE_COMMENT, GHEvent.PULL_REQUEST);

private static final List<String> ALLOWED_ACTIONS = Arrays.asList("edited", "labeled", "opened", "reopened", "synchronize",
"unlabeled");

private static final transient boolean INSECURE_WEBHOOKS = SystemProperties.getBoolean(
GhprbRepository.class.getName() + ".webhook.insecure", false);

Expand Down Expand Up @@ -393,7 +397,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;
Expand Down