diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java index 9a8d39f..66b5c22 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java @@ -137,16 +137,14 @@ private void handleAction(String event, try { GitHub gh = GitHub.connectAnonymously(); - if (StringUtils.equalsIgnoreCase("issue_comment", event)) { + if (state == GHIssueState.CLOSED) { + LOGGER.log(Level.INFO, "Skip ''{0}'' event on closed PR", event); + return; + } else if (StringUtils.equalsIgnoreCase("issue_comment", event)) { comment = getIssueComment(payload, gh); GHIssueState state = comment.getIssue().getState(); - if (state == GHIssueState.CLOSED) { - LOGGER.log(Level.INFO, "Skip comment on closed PR"); - return; - } - if (!comment.getIssue().isPullRequest()) { LOGGER.log(Level.INFO, "Skip comment on Issue"); return;