From 15729dc61f273fa6879e993734e4e677883dadda Mon Sep 17 00:00:00 2001 From: shiftinv Date: Sat, 3 Sep 2022 16:08:20 +0200 Subject: [PATCH] fix: improve empty PR comment filter --- lib/filter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/filter.ts b/lib/filter.ts index 3c657ab..2dcfb9a 100644 --- a/lib/filter.ts +++ b/lib/filter.ts @@ -21,8 +21,10 @@ export default function filter(headers: Headers, json: any, config: UrlConfig): } if (event === "pull_request_review") { + // ignore edit/dismiss actions if (json.action !== "submitted") return "no-op PR review event"; - else if (json.review?.body === null) return "empty PR review"; + // if comment (not approval or changes requested), ignore empty review body + else if (json.review?.state === "commented" && !json.review?.body) return "empty PR review"; } const login: string | undefined = json.sender?.login?.toLowerCase();