Skip to content

Commit

Permalink
Fix compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPGreen committed Aug 19, 2024
1 parent 48e9003 commit 373a6b8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,16 @@ private void handleAction(String event,
try {
GitHub gh = GitHub.connectAnonymously();

if (state == GHIssueState.CLOSED) {
LOGGER.log(Level.INFO, "Skip ''{0}'' event on closed PR", event);
return;
} else if (StringUtils.equalsIgnoreCase("issue_comment", event)) {
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;
Expand All @@ -159,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()});
Expand Down

0 comments on commit 373a6b8

Please sign in to comment.