From 40676dd32b2a3231004cf2a17e17b33af029ab95 Mon Sep 17 00:00:00 2001 From: stianst Date: Thu, 29 Feb 2024 07:36:25 +0100 Subject: [PATCH] Allow bug action by anyone in org Closes #40 Signed-off-by: stianst --- .../java/org/keycloak/gh/bot/BugActionsOnComment.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java b/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java index 5545343..bcdbc50 100644 --- a/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java +++ b/src/main/java/org/keycloak/gh/bot/BugActionsOnComment.java @@ -6,8 +6,6 @@ import org.keycloak.gh.bot.labels.Kind; import org.keycloak.gh.bot.utils.Labels; import org.kohsuke.github.GHEventPayload; -import org.kohsuke.github.GHLabel; -import org.kohsuke.github.GHPermissionType; import java.io.IOException; @@ -16,12 +14,10 @@ public class BugActionsOnComment { @Inject BugActions bugActions; - void onLabeled(@IssueComment.Created GHEventPayload.IssueComment payload) throws IOException { + void onCommentCreated(@IssueComment.Created GHEventPayload.IssueComment payload) throws IOException { if (Labels.hasLabel(payload.getIssue(), Kind.BUG.toLabel())) { Action action = getAction(payload.getComment().getBody()); - - GHPermissionType permission = payload.getRepository().getPermission(payload.getSender()); - if (GHPermissionType.WRITE.equals(permission) || GHPermissionType.ADMIN.equals(permission)) { + if (payload.getSender().isMemberOf(payload.getOrganization())) { bugActions.runAction(action, payload.getIssue()); } }