Making WordPress.org

Changeset 10736


Ignore:
Timestamp:
03/02/2021 03:17:51 AM (4 years ago)
Author:
dd32
Message:

Trac: PRs: Ignore all ....[bot] bot users when syncing comments.

Fixes #5644.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/webhook.php

    r10735 r10736  
    171171        }
    172172
    173         // Ignore some bots.
     173        // Ignore all bots, keeping the explicit list for future reference.
    174174        $ignored_users = [
    175175            'github-actions[bot]',
    176176            'codecov[bot]',
    177177        ];
    178         if ( in_array( $payload->comment->user->login, $ignored_users, true ) ) {
     178        if (
     179            in_array( $payload->comment->user->login, $ignored_users, true ) ||
     180            '[bot]' === substr( $payload->comment->user->login, -5 ) // All bot users.
     181        ) {
    179182            die( 'IGNORED - Comment by ignored user.' );
    180183        }
Note: See TracChangeset for help on using the changeset viewer.