Author: Ilija Tovilo (iluuu1994)
Committer: Nikita Popov (nikic)
Date: 2022-05-03T21:15:32+02:00

Commit: 
https://github.com/php/web-master/commit/819df1572d778f6ee6cebf8c427347b7f39fcec7
Raw diff: 
https://github.com/php/web-master/commit/819df1572d778f6ee6cebf8c427347b7f39fcec7.diff

Don't send any mails for PR/issue comments

See https://github.com/php/php-src/pull/7971

In attempt to reduce e-mail flooding, only send notifications for new
issues and pull requests. If you wish to receive all notifications you
can watch issues/PRs on GitHub.

Changed paths:
  M  public/github-webhook.php


Diff:

diff --git a/public/github-webhook.php b/public/github-webhook.php
index 83dd3f7..663af36 100644
--- a/public/github-webhook.php
+++ b/public/github-webhook.php
@@ -388,39 +388,6 @@ function handle_push_mail($payload) {
         send_mail($to, $subject, $message, MailAddress::noReply($username));
         break;
 
-    case 'pull_request_review_comment':
-    case 'issue_comment':
-        $action = $payload->action;
-        $issue = $event == 'issue_comment' ? $payload->issue : 
$payload->pull_request;
-        $htmlUrl = $issue->html_url;
-
-        $username = $payload->comment->user->login;
-        $comment = $payload->comment->body;
-
-        $isPR = is_pr($issue);
-        $to = get_issue_mailing_list($repoName, $isPR);
-        if ($to === null) {
-            echo "Not sending mail for $repoName (no mailing list)";
-            return;
-        }
-
-        $subject = prep_title($issue, $repoName);
-        $type = $isPR ? 'Pull Request' : 'Issue';
-
-        $message = sprintf("%s: %s\r\n", $type, $htmlUrl);
-        switch ($action) {
-            case 'created':
-                $message .= sprintf("Comment Author: %s\r\n\r\n%s", $username, 
$comment);
-                break;
-            case 'edited':
-            case 'deleted':
-                // Ignore these actions
-                break 2;
-        }
-
-        send_mail($to, $subject, $message, MailAddress::noReply($username));
-        break;
-
     case 'push':
         if ($payload->ref === 'refs/heads/master') {
             // Only close bugs for pushes to master.

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to