diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java index 9a8d39fc4..395709525 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java @@ -161,6 +161,13 @@ private void handleAction(String event, } else if (StringUtils.equalsIgnoreCase("pull_request", event)) { pr = getPullRequest(payload, gh); + GHIssueState state = pr.getPullRequest().getState(); + + if (state == GHIssueState.CLOSED) { + LOGGER.log(Level.INFO, "Skip ''{0}'' event on closed PR", event); + return; + } + repoName = pr.getRepository().getFullName(); LOGGER.log(Level.INFO, "Checking PR #{1} for {0}", new Object[] {repoName, pr.getNumber()});