Skip to content

Commit 2d5aa95

Browse files
committedNov 29, 2023
feat: do not hide comments from organization members
1 parent eb4bf4b commit 2d5aa95

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎index.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,17 @@ async function hideUnhelpfulComments() {
248248
const { comment, action, issue } = context.payload
249249
if (action !== "created" || !comment || !issue) return
250250

251-
const { node_id: subjectId, body, id: comment_id } = comment
251+
const {
252+
node_id: subjectId,
253+
body,
254+
id: comment_id,
255+
author_association,
256+
} = comment
257+
258+
// https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment
259+
// https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
260+
if (author_association === "MEMBER")
261+
return debug("Comment was made by an organization owner, skipping...")
252262

253263
if (!isUnhelpfulComment(body) && !isStillHappeningWithoutLink(body)) return
254264

0 commit comments

Comments
 (0)
Please sign in to comment.