From 2a860e5e9517faf4c16fde792f32393032e98e09 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:45:40 +0200 Subject: [PATCH] Update release.php --- .github/scripts/release.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/scripts/release.php b/.github/scripts/release.php index 1695efa..a276362 100644 --- a/.github/scripts/release.php +++ b/.github/scripts/release.php @@ -25,6 +25,14 @@ if ( empty( $acf_pro_license ) ) { exit( 1 ); } +$acf_pro_url = getenv( 'ACF_PRO_URL' ); + +if ( empty( $acf_pro_url ) ) { + echo 'ACF PRO license URL not defined in `ACF_PRO_URL` environment variable.'; + + exit( 1 ); +} + /** * Request info. */ @@ -46,7 +54,7 @@ $data_plugins = [ $data_wp = [ 'wp_name' => 'acf', - 'wp_url' => 'http://acf.local', + 'wp_url' => $acf_pro_url, 'wp_version' => '6.3', 'wp_language' => 'en-US', 'wp_timezone' => '', @@ -72,8 +80,6 @@ $data = run( $result = json_decode( $data ); -var_dump( $result ); - if ( ! is_object( $result ) ) { throw new Exception( sprintf( @@ -111,6 +117,12 @@ $version = $plugin->new_version; $url = $plugin->package; +if ( '' === $url ) { + echo 'Package URL is empty'; + + exit( 1 ); +} + line( sprintf( 'ACF Version: %s',