Commit a51335c5067 for woocommerce

commit a51335c5067a8a939ab7b087efd13b2343e41eb8
Author: Jorge A. Torres <jorge.torres@automattic.com>
Date:   Thu Aug 20 11:51:25 2026 +0100

    List the open PRs that block the release ZIP build (#67422)

diff --git a/.github/workflows/release-build-zip-file.yml b/.github/workflows/release-build-zip-file.yml
index 28067fceebe..4f9f1ed0043 100644
--- a/.github/workflows/release-build-zip-file.yml
+++ b/.github/workflows/release-build-zip-file.yml
@@ -83,7 +83,12 @@ jobs:
           BRANCH: ${{ steps.normalize-branch.outputs.branch }}
         run: |
           if ! git ls-remote --exit-code --heads https://github.com/${GITHUB_REPOSITORY} ${BRANCH} > /dev/null; then
-            echo "::error::Source branch '$BRANCH' does not exist."
+            error="Source branch '$BRANCH' does not exist."
+            if [[ "$BRANCH" =~ ^(release/)?([0-9]+\.[0-9]+)\..+$ ]]; then
+              minor="${BASH_REMATCH[2]}"
+              error="$error Try 'release/$minor' or '$minor' instead."
+            fi
+            echo "::error::$error"
             exit 1
           fi

@@ -146,11 +151,15 @@ jobs:
           GH_TOKEN: ${{ github.token }}
           GH_REPO: ${{ github.repository }}
         run: |
-            # Helper to fail with console error and summary message.
+            # Helper to fail with a console error and summary message. An optional second
+            # argument adds more detail (e.g. a PR list) to the summary only.
             fail() {
               echo "::error::$1"
               echo "" >> $GITHUB_STEP_SUMMARY
-              echo "❌ Build failed. See annotations or workflow logs for details." >> $GITHUB_STEP_SUMMARY
+              echo "❌ Build failed: $1" >> $GITHUB_STEP_SUMMARY
+              if [[ -n "$2" ]]; then
+                echo "$2" >> $GITHUB_STEP_SUMMARY
+              fi
               exit 1
             }

@@ -195,17 +204,31 @@ jobs:
               fi
             fi

-            # No non-draft PRs against release branch should remain open.
-            count=$( gh pr list --search "is:open draft:false base:$BRANCH" --limit 1 --json number | jq length )
-            if (( count > 0 )); then
-              fail "There are open PRs against the release branch ($BRANCH)."
-            fi
-
-            # No non-draft PRs with same milestone as main version should remain open.
+            # No non-draft PRs against the release branch, or carrying its milestone, should remain open.
             milestone="$version_prefix.0"
-            count=$( gh pr list --search "is:open draft:false milestone:$milestone" --limit 1 --json number | jq length )
-            if (( count > 0 )); then
-              fail "There are open PRs with milestone '$milestone'."
+            pr_query="repo:$GH_REPO is:pr is:open draft:false (base:$BRANCH OR milestone:$milestone) sort:created-asc"
+            search_result=$( gh api graphql -f query='
+              query($q: String!, $limit: Int!) {
+                search(query: $q, type: ISSUE_ADVANCED, first: $limit) {
+                  issueCount
+                  nodes { ... on PullRequest { number title url } }
+                }
+              }' -f q="$pr_query" -F limit=20 --jq '.data.search' )
+            blocking_total=$( echo "$search_result" | jq '.issueCount' )
+            blocking_prs=$( echo "$search_result" | jq '.nodes' )
+            if (( blocking_total > 0 )); then
+              details=$( {
+                echo "$blocking_prs" | jq -r '.[] | "- *[\(.title) #\(.number)](\(.url))*"'
+                if (( blocking_total > 20 )); then
+                  search_url="https://github.com/${GH_REPO}/pulls?q=$( echo -n "$pr_query" | jq -sRr @uri )"
+                  echo "- ... and $(( blocking_total - 20 )) more ([view all]($search_url))"
+                fi
+                if [[ $branch_plugin_version == *-beta* ]]; then
+                  echo ""
+                  echo "If a PR can't be merged or closed right now, temporarily marking it as a draft can be used as a workaround."
+                fi
+              } )
+              fail "There are open PRs against the release branch ($BRANCH) or with milestone '$milestone'." "$details"
             fi

             # Changelog section must have at least one entry.
diff --git a/.github/workflows/release-bump-version.yml b/.github/workflows/release-bump-version.yml
index 442236a1723..8f5f7419d64 100644
--- a/.github/workflows/release-bump-version.yml
+++ b/.github/workflows/release-bump-version.yml
@@ -62,7 +62,12 @@ jobs:
           BRANCH: ${{ steps.normalize-branch.outputs.branch }}
         run: |
           if ! git ls-remote --exit-code --heads https://github.com/${GITHUB_REPOSITORY} "$BRANCH" > /dev/null; then
-            echo "::error::Source branch '$BRANCH' does not exist."
+            error="Source branch '$BRANCH' does not exist."
+            if [[ "$BRANCH" =~ ^(release/)?([0-9]+\.[0-9]+)\..+$ ]]; then
+              minor="${BASH_REMATCH[2]}"
+              error="$error Try 'release/$minor' or '$minor' instead."
+            fi
+            echo "::error::$error"
             exit 1
           fi

diff --git a/.linear/release-kickoff-beta.md b/.linear/release-kickoff-beta.md
index b31d96ed66c..c9f635e7608 100644
--- a/.linear/release-kickoff-beta.md
+++ b/.linear/release-kickoff-beta.md
@@ -13,7 +13,7 @@ Keep the _[Release Troubleshooting & Recovery](https://developer.woocommerce.com
 ### 1. Pre-build checks

 - [ ] Confirm [GitHub services](https://www.githubstatus.com/) are operational.
-- [ ] Verify no open [issues]({repository_url}/issues?q=is:open+is:issue+milestone:{release_milestone}) or [pull requests]({repository_url}/pulls?q=is:open+is:pr+draft:false+milestone:{release_milestone}) exist against the `{release_milestone}` milestone. Ping authors as needed to merge or close.
+- [ ] Verify no open [issues]({repository_url}/issues?q=is:open+is:issue+milestone:{release_milestone}) or [pull requests]({repository_url}/pulls?q=is:open+is:pr+draft:false+milestone:{release_milestone}) exist against the `{release_milestone}` milestone. Ping authors to merge or close; if that can't happen yet, mark the PR as a draft.
 - [ ] Ensure that there aren't any pull requests [with label "cherry pick failed"]({repository_url}/pulls?q=is:pr+label:%22cherry+pick+failed%22) that apply to this release that haven't been actioned.
 - [ ] Confirm the `Stable tag` value [in the readme.txt on the release branch]({repository_url}/blob/{release_branch}/plugins/woocommerce/readme.txt#L7) matches the one [on WordPress.org's `trunk`](https://plugins.trac.wordpress.org/browser/woocommerce/trunk/readme.txt#L7).

diff --git a/docs/contribution/releases/building-and-publishing.md b/docs/contribution/releases/building-and-publishing.md
index 6210dc9b0ca..1b1e4d47d23 100644
--- a/docs/contribution/releases/building-and-publishing.md
+++ b/docs/contribution/releases/building-and-publishing.md
@@ -29,7 +29,7 @@ Keep the _[Release Troubleshooting & Recovery](/docs/contribution/releases/troub
 #### 1. Pre-build checks

 - [ ] Confirm [GitHub services](https://www.githubstatus.com/) are operational.
-- [ ] Verify no open issues or pull requests exist against the [release milestone](https://github.com/woocommerce/woocommerce/milestones/). Ping authors as needed to merge or close.
+- [ ] Verify no open issues or pull requests exist against the [release milestone](https://github.com/woocommerce/woocommerce/milestones/). Ping authors as needed to merge or close; for betas, marking a PR as a draft works as a temporary workaround.
 - [ ] Ensure that there aren't any pull requests [with label "cherry pick failed"](https://github.com/woocommerce/woocommerce/pulls?q=is:pr+label:%22cherry+pick+failed%22) that apply to this release that haven't been actioned.
 - [ ] Confirm the `Stable tag` value in the readme.txt on the release branch matches the one [on WordPress.org's `trunk`](https://plugins.trac.wordpress.org/browser/woocommerce/trunk/readme.txt#L7).