From 2a90d90e2e9565fc68a5e19129b98730b26c5e76 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 25 Oct 2023 14:38:41 -0400 Subject: [PATCH] validate that wp versions match in release workflow --- .github/workflows/upload-asset-on-release.yml | 11 ++++++++++- .wp-env.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upload-asset-on-release.yml b/.github/workflows/upload-asset-on-release.yml index 4acafab..348c232 100644 --- a/.github/workflows/upload-asset-on-release.yml +++ b/.github/workflows/upload-asset-on-release.yml @@ -81,9 +81,18 @@ jobs: - name: Install PHP Dependencies run: composer install --no-progress --no-dev --optimize-autoloader --prefer-dist - - name: npm install + - name: NPM Install run: npm install --legacy-peer-deps + - name: Validate WP Versions + if: ${{ (github.repository == 'bluehost/mojo-marketplace-wp-plugin') && (github.event.release.prerelease == false) }} + run: | + wpEnvVersion=`grep "WordPress/WordPress#tags/" .wp-env.json | grep -Eo "[0-9\.]*"` + pluginHeaderTestedVersion=`grep "Tested up to:" mojo-marketplace.php | grep -Eo "[0-9\.]*"` + echo "wp-env version: $wpEnvVersion" + echo "Plugin header tested version: $pluginHeaderTestedVersion" + [[ "$wpEnvVersion" == "$pluginHeaderTestedVersion" ]] || exit 1 + - name: Build JavaScript run: npm run build diff --git a/.wp-env.json b/.wp-env.json index cb83304..519b1be 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,5 +1,5 @@ { - "core": "WordPress/WordPress#tags/6.3.1", + "core": "WordPress/WordPress#tags/6.3.2", "config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true,