From dfb34d2b66d9a2d63ce38e7058449e79f799121a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 25 Oct 2023 14:31:16 -0400 Subject: [PATCH] validate that tested version of wp matches the wp-env version in release workflow --- .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 00534ec2..ffe83236 100644 --- a/.github/workflows/upload-asset-on-release.yml +++ b/.github/workflows/upload-asset-on-release.yml @@ -101,6 +101,15 @@ jobs: - name: NPM Install run: npm install --legacy-peer-deps + - name: Validate WP Versions + if: ${{ (github.repository == 'newfold-labs/wp-plugin-hostgator') && (github.event.release.prerelease == false) }} + run: | + wpEnvVersion=`grep "WordPress/WordPress#tags/" .wp-env.json | grep -Eo "[0-9\.]*"` + pluginHeaderTestedVersion=`grep "Tested up to:" wp-plugin-hostgator.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