Changeset 10410 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
- Timestamp:
- 10/27/2020 02:41:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r10243 r10410 1 1 <?php 2 use WordPressdotorg\Theme_Directory\Lib\GitHub; 2 3 3 4 /** … … 323 324 324 325 do_action( 'theme_upload', $this->theme, $this->theme_post ); 326 327 // Initiate a GitHub actions run for the theme. 328 $this->trigger_e2e_run( $ticket_id ); 325 329 326 330 // Success! … … 948 952 } 949 953 954 /** 955 * Triggers a GitHub actions run for the upload. 956 */ 957 public function trigger_e2e_run( $ticket_id ) { 958 $api = GitHub::api( 959 '/repos/' . WPORG_THEMES_E2E_REPO . '/dispatches', 960 json_encode([ 961 'event_type' => $this->theme->display( 'Name' ), 962 'client_payload' => [ 963 'theme_slug' => $this->theme_slug, 964 'theme_zip' => "https://wordpress.org/themes/download/{$this->theme_slug}.{$this->theme->display( 'Version' )}.zip?nostats=1", 965 'accessible_ready' => in_array( 'accessibility-ready', $this->theme->get( 'Tags' ) ), 966 'trac_ticket_id' => $ticket_id, 967 ], 968 ]) 969 ); 970 971 // Upon failure a message is returned, success returns nothing. 972 return empty( $api ); 973 } 974 950 975 // Helper 951 976
Note: See TracChangeset
for help on using the changeset viewer.