From 6895ebac31d54d8f242ae3b1e03efce5514a2517 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 10 Sep 2026 17:57:50 +0000 Subject: [PATCH 1/7] Workflows: Narrow release and wp branch filters to X.Y The `release/**` and `wp/**` globs match any ref under those prefixes, including nested ones such as `release/2.5/something-else` and one-off working branches like `release/23.2-cherry-pick` or `wp/6.7_meta-boxes-unsplit-with-device-previews`. Replace them with `release/[0-9]+.[0-9]` and `wp/[0-9]+.[0-9]`, which match a major version of any length followed by a single-digit minor version, and nothing else. `+` and `[]` are both supported by the GitHub Actions filter pattern syntax. `wp/latest` and `wp/next` are long-lived branches that the old `wp/**` glob covered, and the package release process depends on the build for `wp/latest` passing. List both explicitly so they keep their coverage. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01T6xDpCEksxnHD9LvcfRZdx --- .github/workflows/build-plugin-zip.yml | 6 ++++-- .github/workflows/end2end-test.yml | 6 ++++-- .github/workflows/static-checks.yml | 6 ++++-- .github/workflows/unit-test.yml | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index c36a8cf1ece93c..f78f6574e308cf 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -5,8 +5,10 @@ on: push: branches: - trunk - - 'release/**' - - 'wp/**' + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next workflow_dispatch: inputs: version: diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index 69807c1bdd3fd9..26b9bed2948881 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -5,8 +5,10 @@ on: push: branches: - trunk - - 'release/**' - - 'wp/**' + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next # Cancels all previous workflow runs for pull requests that have not completed. concurrency: diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index e969dd79d185fe..ad415f704d3b49 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -5,8 +5,10 @@ on: push: branches: - trunk - - 'release/**' - - 'wp/**' + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next # Cancels all previous workflow runs for pull requests that have not completed. concurrency: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 848f521085b317..7dc6caeb60b279 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -5,8 +5,10 @@ on: push: branches: - trunk - - 'release/**' - - 'wp/**' + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next # Allow manually triggering the workflow. workflow_dispatch: From 12012bf8adb737e80591169057ed0b75eeeeccaf Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 10 Sep 2026 18:25:58 +0000 Subject: [PATCH 2/7] Workflows: Add missing push and pull_request branch filters Several workflows declared `push` or `pull_request` with no branch filter at all, so they ran for every base branch in the repository. Give each the filter its job actually calls for. - `build-plugin-zip`, `end2end-test`, `static-checks` and `unit-test` gain a `pull_request` filter matching their `push` filter, so the suites that guard a branch also guard the pull requests targeting it. - `performance` and `create-block` move to that same set on both events. - `workflow-lint` widens from `trunk` to that same set on both events: the workflow files on a release or `wp/*` branch need linting too. - `bundle-size` gains the same set on `pull_request`. The comparison builds whatever the pull request is based on, taking the base from the event payload, so it is not tied to `trunk`. - `storybook-check` narrows to `trunk` on `pull_request`, matching its `push` filter. Storybook is only published from `trunk`. `performance` published its push results under a hardcoded `trunk` series name. Now that pushes to the release and `wp/*` branches run it too, pass the branch the run is for instead, so their measurements no longer land in the `trunk` history. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01T6xDpCEksxnHD9LvcfRZdx --- .github/workflows/build-plugin-zip.yml | 6 ++++++ .github/workflows/bundle-size.yml | 6 ++++++ .github/workflows/create-block.yml | 13 ++++++++++++- .github/workflows/end2end-test.yml | 6 ++++++ .github/workflows/performance.yml | 18 ++++++++++++++++-- .github/workflows/static-checks.yml | 6 ++++++ .github/workflows/storybook-check.yml | 2 ++ .github/workflows/unit-test.yml | 6 ++++++ .github/workflows/workflow-lint.yml | 8 ++++++++ 9 files changed, 68 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index f78f6574e308cf..a4613be17dc56c 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -2,6 +2,12 @@ name: Build Gutenberg Plugin Zip on: pull_request: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next push: branches: - trunk diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index a9671b8811e047..96aae6c38991f5 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -2,6 +2,12 @@ name: Compressed Size on: pull_request: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next paths: # Any change to a CSS, Sass, or JavaScript/TypeScript file should run checks. - '**.js' diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml index 359f8f0f8ed963..ab43bcb9aa6be3 100644 --- a/.github/workflows/create-block.yml +++ b/.github/workflows/create-block.yml @@ -2,8 +2,19 @@ name: Create Block on: pull_request: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next push: - branches: [trunk, wp/latest] + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next # Cancels all previous workflow runs for pull requests that have not completed. concurrency: diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index 26b9bed2948881..25d527f2c012d0 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -2,6 +2,12 @@ name: End-to-End Tests on: pull_request: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next push: branches: - trunk diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index cb01e8bab4ef37..1d281603cb5891 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -2,10 +2,21 @@ name: Performance Tests on: pull_request: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next release: types: [published] push: - branches: [trunk] + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next workflow_dispatch: inputs: branches: @@ -419,10 +430,13 @@ jobs: env: CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }} BRANCHES: ${{ needs.prepare.outputs.branches }} + # The series the results are recorded under. Now that pushes to the + # release and `wp/*` branches run too, this can no longer be `trunk`. + BRANCH_NAME: ${{ github.ref_name }} run: | COMMITTED_AT="$(git show -s "$GITHUB_SHA" --format="%cI")" REFERENCE_COMMIT="$(echo "$BRANCHES" | jq -r '.[1].name')" - node tools/release/log-performance-results.js "$CODEHEALTH_PROJECT_TOKEN" trunk "$GITHUB_SHA" "$REFERENCE_COMMIT" "$COMMITTED_AT" + node tools/release/log-performance-results.js "$CODEHEALTH_PROJECT_TOKEN" "$BRANCH_NAME" "$GITHUB_SHA" "$REFERENCE_COMMIT" "$COMMITTED_AT" pr-meta: name: Update PR meta comment diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index ad415f704d3b49..1ea0e72f82d27c 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -2,6 +2,12 @@ name: Static Analysis (Linting, License, Type checks...) on: pull_request: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next push: branches: - trunk diff --git a/.github/workflows/storybook-check.yml b/.github/workflows/storybook-check.yml index 3e4f50630ff1ef..511818a54ca2d9 100644 --- a/.github/workflows/storybook-check.yml +++ b/.github/workflows/storybook-check.yml @@ -2,6 +2,8 @@ name: Storybook build and Smoke Tests on: pull_request: + branches: + - trunk push: branches: - trunk diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 7dc6caeb60b279..3dac7fc2eb6777 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -2,6 +2,12 @@ name: Unit Tests on: pull_request: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next push: branches: - trunk diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index fa11fa1c3673bf..02f6b4d6fa811d 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -4,6 +4,10 @@ on: push: branches: - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next paths: # Only run when changes are made to workflow files. - '.github/workflows/**' @@ -13,6 +17,10 @@ on: pull_request: branches: - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next paths: # Only run when changes are made to workflow files. - '.github/workflows/**' From c9bca9eb067fb2cc6b99edffa0965a87a594a4f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 10 Sep 2026 18:38:55 +0000 Subject: [PATCH 3/7] Workflows: Scope the pull request automation push trigger The `push` key carried no branch filter, so every push to every branch in the repository checked the repository out, installed Node and ran a build. Scope it to the same branches the other workflows now use. Both push-driven tasks still return early unless the ref is `trunk`, which they check themselves in `add-milestone` and `first-time-contributor-account-link`. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01T6xDpCEksxnHD9LvcfRZdx --- .github/workflows/pull-request-automation.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml index ddf29edc19fc22..28a07d95cb2327 100644 --- a/.github/workflows/pull-request-automation.yml +++ b/.github/workflows/pull-request-automation.yml @@ -2,6 +2,12 @@ on: pull_request_target: types: [opened] push: + branches: + - trunk + - 'release/[0-9]+.[0-9]' + - 'wp/[0-9]+.[0-9]' + - wp/latest + - wp/next name: Pull request automation # Disable permissions for all available scopes by default. From 4c52e8ded72e64e7a6a30aff0f8d4102b8351f2e Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 10 Sep 2026 19:37:46 -0400 Subject: [PATCH 4/7] Project management tasks for `push` only run on `trunk`. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/pull-request-automation.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml index 28a07d95cb2327..4bc9cc193ffb48 100644 --- a/.github/workflows/pull-request-automation.yml +++ b/.github/workflows/pull-request-automation.yml @@ -4,10 +4,6 @@ on: push: branches: - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next name: Pull request automation # Disable permissions for all available scopes by default. From ec5c201f85c0843034603b22bc62f244e1909605 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 10 Sep 2026 19:51:18 -0400 Subject: [PATCH 5/7] Only add a trunk branch filter for pull_request. --- .github/workflows/performance.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 1d281603cb5891..881cf735c784bc 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -2,21 +2,11 @@ name: Performance Tests on: pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next + branches: [trunk] release: types: [published] push: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next + branches: [trunk] workflow_dispatch: inputs: branches: @@ -430,13 +420,10 @@ jobs: env: CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }} BRANCHES: ${{ needs.prepare.outputs.branches }} - # The series the results are recorded under. Now that pushes to the - # release and `wp/*` branches run too, this can no longer be `trunk`. - BRANCH_NAME: ${{ github.ref_name }} run: | COMMITTED_AT="$(git show -s "$GITHUB_SHA" --format="%cI")" REFERENCE_COMMIT="$(echo "$BRANCHES" | jq -r '.[1].name')" - node tools/release/log-performance-results.js "$CODEHEALTH_PROJECT_TOKEN" "$BRANCH_NAME" "$GITHUB_SHA" "$REFERENCE_COMMIT" "$COMMITTED_AT" + node tools/release/log-performance-results.js "$CODEHEALTH_PROJECT_TOKEN" trunk "$GITHUB_SHA" "$REFERENCE_COMMIT" "$COMMITTED_AT" pr-meta: name: Update PR meta comment From 3fe3bd4aceb8331161e99d9bfc6a7463c048fcac Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Fri, 11 Sep 2026 10:26:08 -0400 Subject: [PATCH 6/7] Revert increased specificity for `pull_request`. --- .github/workflows/build-plugin-zip.yml | 6 ------ .github/workflows/bundle-size.yml | 6 ------ .github/workflows/create-block.yml | 6 ------ .github/workflows/end2end-test.yml | 6 ------ .github/workflows/performance.yml | 1 - .github/workflows/static-checks.yml | 6 ------ .github/workflows/unit-test.yml | 6 ------ .github/workflows/workflow-lint.yml | 6 ------ 8 files changed, 43 deletions(-) diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index a4613be17dc56c..f78f6574e308cf 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -2,12 +2,6 @@ name: Build Gutenberg Plugin Zip on: pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next push: branches: - trunk diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index 96aae6c38991f5..a9671b8811e047 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -2,12 +2,6 @@ name: Compressed Size on: pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next paths: # Any change to a CSS, Sass, or JavaScript/TypeScript file should run checks. - '**.js' diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml index ab43bcb9aa6be3..29daef4fc1f00b 100644 --- a/.github/workflows/create-block.yml +++ b/.github/workflows/create-block.yml @@ -2,12 +2,6 @@ name: Create Block on: pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next push: branches: - trunk diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index 25d527f2c012d0..26b9bed2948881 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -2,12 +2,6 @@ name: End-to-End Tests on: pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next push: branches: - trunk diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 881cf735c784bc..cb01e8bab4ef37 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -2,7 +2,6 @@ name: Performance Tests on: pull_request: - branches: [trunk] release: types: [published] push: diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index 1ea0e72f82d27c..ad415f704d3b49 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -2,12 +2,6 @@ name: Static Analysis (Linting, License, Type checks...) on: pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next push: branches: - trunk diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 3dac7fc2eb6777..7dc6caeb60b279 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -2,12 +2,6 @@ name: Unit Tests on: pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next push: branches: - trunk diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index 02f6b4d6fa811d..d9b3c6e30b54c7 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -15,12 +15,6 @@ on: - 'packages/**/action.yml' - 'tools/**/action.yml' pull_request: - branches: - - trunk - - 'release/[0-9]+.[0-9]' - - 'wp/[0-9]+.[0-9]' - - wp/latest - - wp/next paths: # Only run when changes are made to workflow files. - '.github/workflows/**' From 049b43b6279030fe91a57d7ffe42950af7732ccf Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Fri, 11 Sep 2026 12:40:56 -0400 Subject: [PATCH 7/7] Revert branch filtering for storybook-check. --- .github/workflows/storybook-check.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/storybook-check.yml b/.github/workflows/storybook-check.yml index 511818a54ca2d9..3e4f50630ff1ef 100644 --- a/.github/workflows/storybook-check.yml +++ b/.github/workflows/storybook-check.yml @@ -2,8 +2,6 @@ name: Storybook build and Smoke Tests on: pull_request: - branches: - - trunk push: branches: - trunk