Skip to content

Commit 1a3642d

Browse files
Fix for issue jenkinsci#29
1 parent 2195d9c commit 1a3642d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/main/java/org/jenkinsci/plugins/pipeline/github/trigger/GitHubEventSubscriber.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ protected void onEvent(final GHSubscriberEvent event) {
7575
}
7676

7777
private void handleIssueComment(final GHSubscriberEvent event) {
78-
GHEventPayload.IssueComment issueCommentEvent;
79-
8078
// we only care about created or updated events
8179
switch (event.getType()) {
8280
case CREATED:
@@ -87,6 +85,7 @@ private void handleIssueComment(final GHSubscriberEvent event) {
8785
}
8886

8987
// decode payload
88+
final GHEventPayload.IssueComment issueCommentEvent;
9089
try {
9190
issueCommentEvent = GitHub.offline()
9291
.parseEventPayload(new StringReader(event.getPayload()), GHEventPayload.IssueComment.class);
@@ -95,6 +94,16 @@ private void handleIssueComment(final GHSubscriberEvent event) {
9594
return;
9695
}
9796

97+
switch (issueCommentEvent.getAction()) {
98+
case "created":
99+
case "edited":
100+
break;
101+
default:
102+
LOG.debug("Ignoring IssueComment: {} with Action: {}",
103+
issueCommentEvent.getComment(), issueCommentEvent.getAction());
104+
return;
105+
}
106+
98107
// create key for this comment's PR
99108
final String key = String.format("%s/%s/%d",
100109
issueCommentEvent.getRepository().getOwnerName(),

0 commit comments

Comments
 (0)