Skip to content

Commit

Permalink
Ignore bot accounts in wp maintenance contrib-list (#55)
Browse files Browse the repository at this point in the history
* Ignore bot accounts in `contrib-list`

* Fix PHPCS issues

---------

Co-authored-by: Daniel Bachhuber <[email protected]>
  • Loading branch information
swissspidy and danielbachhuber authored Nov 1, 2023
1 parent 049cede commit 5bde32b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .maintenance/src/Contrib_List_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ final class Contrib_List_Command {
* @when before_wp_load
*/
public function __invoke( $args, $assoc_args ) {
$repos = null;
$use_bundle = false;

$repos = null;
$milestone_names = null;
$use_bundle = false;
$ignored_contributors = [
'github-actions[bot]',
];

if ( count( $args ) > 0 ) {
$repos = [ array_shift( $args ) ];
Expand Down Expand Up @@ -196,6 +198,8 @@ function ( $a, $b ) {
}
}

$contributors = array_diff( $contributors, $ignored_contributors );

WP_CLI::log( 'Total contributors: ' . count( $contributors ) );
WP_CLI::log( 'Total pull requests: ' . $pull_request_count );

Expand Down

0 comments on commit 5bde32b

Please sign in to comment.