- Timestamp:
- 05/22/2020 04:27:29 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/functions.php
r9877 r9897 12 12 if ( ! $data || ! $data->number ) { 13 13 return false; 14 } 15 16 // Get Travis CI State. 17 $check_runs = []; 18 $raw_check_runs = api_request( 19 '/repos/' . $repo . '/commits/' . $data->head->sha . '/check-runs', 20 null, 21 [ 'Accept: application/vnd.github.antiope-preview+json' ] 22 ); 23 if ( !empty( $raw_check_runs->check_runs ) ) { 24 foreach ( $raw_check_runs->check_runs as $check ) { 25 switch ( $check->status ) { 26 case 'queued': 27 case 'in_progress': 28 $check_runs[ $check->app->name ] = 'in_progress'; 29 break; 30 case 'completed': 31 switch( $check->conclusion ) { 32 case 'success': 33 $check_runs[ $check->app->name ] = 'success'; 34 break; 35 case 'failure': 36 $check_runs[ $check->app->name ] = 'failed'; 37 break; 38 case 'action_required': 39 $check_runs[ $check->app->name ] = $check->output->title; 40 break; 41 } 42 } 43 } 14 44 } 15 45 … … 24 54 'closed_at' => $data->closed_at, 25 55 'mergeable_state' => $data->mergeable_state, 56 'check_runs' => $check_runs, 26 57 'body' => $data->body, 27 58 'user' => (object) [
Note: See TracChangeset
for help on using the changeset viewer.