mirror of
https://github.com/status-im/github-webhook-filter.git
synced 2026-08-31 02:31:08 +00:00
fix: improve empty PR comment filter
This commit is contained in:
+3
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user