From c667c5df24fe37917ab3dfee485680f408456d4a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 08:38:14 +0000 Subject: [PATCH 1/2] Initial plan From 82b816f0429277128d2f72f7e6ac00033bf723b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 08:40:54 +0000 Subject: [PATCH 2/2] feat: resolve WP_VERSION to latest patch when only major.minor is provided Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- bin/run-behat-tests | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/run-behat-tests b/bin/run-behat-tests index 3ee00892..0da65e8b 100755 --- a/bin/run-behat-tests +++ b/bin/run-behat-tests @@ -94,6 +94,20 @@ if [ "${WP_VERSION-latest}" = "latest" ]; then export WP_VERSION=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r ".offers[0].current") fi +# Normalize WP_VERSION=X.Y.0 to X.Y (WordPress uses X.Y for the initial release, not X.Y.0). +# If WP_VERSION=X.Y (major.minor only), resolve to the latest available patch release. +if [[ "${WP_VERSION}" =~ ^([0-9]+\.[0-9]+)\.0$ ]]; then + export WP_VERSION="${BASH_REMATCH[1]}" +elif [[ "${WP_VERSION}" =~ ^[0-9]+\.[0-9]+$ ]]; then + WP_VERSIONS_JSON=$(curl -s https://raw.githubusercontent.com/wp-cli/wp-cli-tests/artifacts/wp-versions.json) + if [ -n "${WP_VERSIONS_JSON}" ]; then + RESOLVED_VERSION=$(echo "${WP_VERSIONS_JSON}" | jq -r --arg prefix "${WP_VERSION}." 'keys | map(select(startswith($prefix))) | sort_by(split(".") | map(tonumber)) | last // empty') + if [ -n "${RESOLVED_VERSION}" ]; then + export WP_VERSION="${RESOLVED_VERSION}" + fi + fi +fi + # To retrieve the WP-CLI tests package root folder, we start with this scripts # location. SOURCE="${BASH_SOURCE[0]}"