From d3a4878170bc02a7196de53cc608a9fe9260d006 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Fri, 20 Oct 2023 13:22:13 -0400 Subject: [PATCH] validate that tested version matches the wp-env version --- .github/workflows/upload-asset-on-release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/upload-asset-on-release.yml b/.github/workflows/upload-asset-on-release.yml index 64eab2231..6988cdbfd 100644 --- a/.github/workflows/upload-asset-on-release.yml +++ b/.github/workflows/upload-asset-on-release.yml @@ -36,6 +36,15 @@ jobs: [[ "$taggedVersion" == "$pluginConstantVersion" ]] || exit 1 [[ "$taggedVersion" == "$pluginPackageVersion" ]] || exit 1 + - name: Validate WP Versions + if: ${{ (github.repository == 'bluehost/bluehost-wordpress-plugin') && (github.event.release.prerelease == false) }} + run: | + pluginHeaderTestedVersion=`grep "Tested up to:" bluehost-wordpress-plugin.php | grep -Eo "[0-9\.]*"` + wpEnvVersion=`grep "WordPress/WordPress#tags/" .wp-env.json | grep -Eo "[0-9\.]*"` + echo "Plugin header tested version: $pluginHeaderTestedVersion" + echo "wp-env version: $wpEnvVersion" + [[ "$wpEnvVersion" == "$pluginHeaderTestedVersion" ]] || exit 1 + - name: Setup PHP uses: shivammathur/setup-php@v2 with: