Skip to content

Improve GHCR asset publishing and expand trigger events to include pull_request#78211

Merged
desrosj merged 3 commits into
trunkfrom
add/publishing-built-assets-for-prs
May 15, 2026
Merged

Improve GHCR asset publishing and expand trigger events to include pull_request#78211
desrosj merged 3 commits into
trunkfrom
add/publishing-built-assets-for-prs

Conversation

@desrosj
Copy link
Copy Markdown
Member

@desrosj desrosj commented May 12, 2026

What?

Expands the publish-to-container-registry job in build-plugin-zip.yml to run on more event types, and publishes a second, mutable tag alongside the existing SHA tag.

Previously the job ran only on push to trunk, release/**, and wp/**. It now also runs on:

  • workflow_dispatch
  • pull_requestonly when the head branch lives in WordPress/gutenberg (fork PRs are explicitly excluded via github.event.pull_request.head.repo.full_name == github.repository)

Every successful publish now produces two tags pointing at the same OCI manifest (added via oras tag, so no duplicated blob storage):

Trigger SHA tag (immutable) Mutable tag
push to trunk <github.sha> trunk
push to release/X.Y <github.sha> release-X.Y
push to wp/X.Y <github.sha> wp-X.Y
workflow_dispatch <github.sha> matches branch
pull_request (internal branch) <pull_request.head.sha> pr-<N>

The SHA tag scheme is unchanged so that https://github.com/WordPress/wordpress-develop/ and any other downstream that pins to gutenberg.sha continues to work without modification.

See WordPress/wordpress-develop#11809 as a companion PR that would add support for this in wordpress-develop.

Why?

There is currently no way to test unmerged changes in the Gutenberg repository in the context of https://github.com/WordPress/wordpress-develop/.

By publishing assets for pull requests, this is now possible. The mutable tag also gives contributors a stable "latest of stream" reference that doesn't require frequent updating of the pinned SHA on every new build. This is especially useful when working on a pull request to ensure the latest changes are present.

How?

This adjusts the workflow logic and makes changes to how the image is tagged through ORAS.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.7
Used for: Analysis and initial draft patch.

@desrosj desrosj self-assigned this May 12, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Comment thread .github/workflows/build-plugin-zip.yml Outdated
Comment thread .github/workflows/build-plugin-zip.yml
Comment on lines +339 to +346
# Add a mutable tag alongside the SHA tag so developers can pull "the latest build for this stream"
# (e.g. :trunk, :pr-12345, :release-19.5) without needing to update a pinned SHA.
- name: Add mutable tag for the built plugin
env:
SOURCE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
MUTABLE_TAG: ${{ steps.mutable_tag.outputs.value }}
run: |
oras tag "ghcr.io/wordpress/gutenberg/gutenberg-wp-develop-build:${SOURCE_SHA}" "${MUTABLE_TAG}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So would the MUTABLE_TAG be usable in gutenberg.sha in the wordpress-develop package.json?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right! I've created WordPress/wordpress-develop#11809 to show how I picture this working from a consumer standpoint.

Co-Authored-By: Weston Ruter <134745+westonruter@users.noreply.github.com>
@desrosj desrosj requested a review from Copilot May 12, 2026 18:37
@desrosj desrosj added [Type] Build Tooling Issues or PRs related to build tooling GitHub Actions Pull requests that update GitHub Actions code labels May 12, 2026
@desrosj desrosj added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label May 12, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the build-plugin-zip.yml workflow to publish the wordpress-develop build artifact to GHCR for additional event types (including internal PRs), and to add a mutable “stream” tag alongside the existing immutable SHA tag so downstream consumers can reference “latest for X”.

Changes:

  • Expand publish-to-container-registry to run on workflow_dispatch and internal pull_request events (excluding fork PRs).
  • Use ORAS to push the artifact under a SHA-based tag and then add a second mutable tag derived from branch name or PR number.
  • Record a SOURCE_SHA value in .gutenberg-hash and OCI annotations for PR runs (using the PR head SHA instead of the ephemeral merge SHA).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build-plugin-zip.yml
Copy link
Copy Markdown
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this!

@desrosj desrosj added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label May 15, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label May 15, 2026
@desrosj desrosj enabled auto-merge (squash) May 15, 2026 04:47
@desrosj
Copy link
Copy Markdown
Member Author

desrosj commented May 15, 2026

I'm going to merge this once the tests pass to give it a shot! I will commit WordPress/wordpress-develop#11809 tomorrow.

@desrosj desrosj merged commit 123cebb into trunk May 15, 2026
44 checks passed
@desrosj desrosj deleted the add/publishing-built-assets-for-prs branch May 15, 2026 05:16
@github-actions github-actions Bot added this to the Gutenberg 23.3 milestone May 15, 2026
@desrosj desrosj added the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label May 15, 2026
desrosj added a commit that referenced this pull request May 15, 2026
…ull_request` (#78211) (#78324)

* Publish assets for pull requests and add mutable tags.

* Remove unnecessary environment variable.

Co-authored-by: westonruter <westonruter@git.wordpress.org>
@t-hamano
Copy link
Copy Markdown
Contributor

This PR was manually merged into the wp/7.0 branch by #78324.

@t-hamano t-hamano added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels May 18, 2026
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request May 19, 2026
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`.

The following changes are included:

- Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298)
- Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324)
- I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214)
- Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370)
- Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371)
- RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267)
- Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797)
- Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd.

Log created with:

git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.

git-svn-id: https://develop.svn.wordpress.org/trunk@62380 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request May 19, 2026
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`.

The following changes are included:

- Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298)
- Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324)
- I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214)
- Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370)
- Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371)
- RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267)
- Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797)
- Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd.

Log created with:

git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.
Built from https://develop.svn.wordpress.org/trunk@62380


git-svn-id: http://core.svn.wordpress.org/trunk@61661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request May 19, 2026
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`.

The following changes are included:

- Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298)
- Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324)
- I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214)
- Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370)
- Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371)
- RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267)
- Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797)
- Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd.

Log created with:

git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

Reviewed by audrasjb.
Merges [62380] to the 7.0 branch.
Fixes #64595.

git-svn-id: https://develop.svn.wordpress.org/branches/7.0@62382 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request May 19, 2026
This updates the pinned hash from the `gutenberg` from `3a4e8d1418d25da83b70158bcaabf65580690b6b ` to `a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd`.

The following changes are included:

- Bump the github-actions group across 1 directory with 5 updates (WordPress/gutenberg#76530) (WordPress/gutenberg#78298)
- Improve GHCR asset publishing and expand trigger events to include `pull_request` (WordPress/gutenberg#78211) (WordPress/gutenberg#78324)
- I18N: Polyfill script module translations for WordPress < 7.0 (WordPress/gutenberg#77214)
- Fonts: Move admin menu compat from experimental to wordpress-7.0 (WordPress/gutenberg#78227) (WordPress/gutenberg#78370)
- Connectors: Consolidate WP 7.0 compat loading and move from experimental (WordPress/gutenberg#78228) (WordPress/gutenberg#78371)
- RTC: Make sync/collaboration APIs private (WordPress/gutenberg#78267)
- Interactivity API: Fix popover bind hydration (WordPress/gutenberg#77797)
- Script Loader: Defer single-page admin init until DOMContentLoaded (Trac WordPress/gutenberg#65103) (WordPress/gutenberg#78136)

A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/3a4e8d1418d25da83b70158bcaabf65580690b6b…a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd.

Log created with:

git log --reverse --format="- %s" 3a4e8d1418d25da83b70158bcaabf65580690b6b..a2a354cf35e5b69c3330d6c1cfd42d8dc2efb9fd | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

Reviewed by audrasjb.
Merges [62380] to the 7.0 branch.
Fixes #64595.
Built from https://develop.svn.wordpress.org/branches/7.0@62382


git-svn-id: http://core.svn.wordpress.org/branches/7.0@61663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request May 27, 2026
The `gutenberg.sha` property in the `package.json` file expects a full-length SHA value to be specified in order to download the built assets from the Gutenberg repository and include the files through the build script.

After WordPress/gutenberg#78211, assets are now published for `pull_request` events in addition to `push` so long as the `HEAD` branch of the pull request exists in the repository and not in a fork. This makes the built assets for pull requests available for testing within `wordpress-develop` before they are merged through a `pr-###` tag on the GHCR package.

To test a given pull request, just set the `gutenberg.sha` value to the corresponding `pr-###` tag. In addition to pull request-specific tags, each `wp/X.Y`, `release/X.Y`, and `trunk` now have a tag that can be used to test the latest changes. Each time `build` or `build:dev` is called the script will attempt to confirm the latest version of the assets are present locally, pulling down the latest changes when an update is available.

All of the tags described in this changeset are mutable, so they should never be committed. Only immutable SHA values should be used for `gutenberg.sha` in commits to this repository.

This commit also adds the related JavaScript files to the TypeScript configuration file.

Props westonruter, jorbin, manhar.
Fixes #65224.

git-svn-id: https://develop.svn.wordpress.org/trunk@62422 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request May 27, 2026
The `gutenberg.sha` property in the `package.json` file expects a full-length SHA value to be specified in order to download the built assets from the Gutenberg repository and include the files through the build script.

After WordPress/gutenberg#78211, assets are now published for `pull_request` events in addition to `push` so long as the `HEAD` branch of the pull request exists in the repository and not in a fork. This makes the built assets for pull requests available for testing within `wordpress-develop` before they are merged through a `pr-###` tag on the GHCR package.

To test a given pull request, just set the `gutenberg.sha` value to the corresponding `pr-###` tag. In addition to pull request-specific tags, each `wp/X.Y`, `release/X.Y`, and `trunk` now have a tag that can be used to test the latest changes. Each time `build` or `build:dev` is called the script will attempt to confirm the latest version of the assets are present locally, pulling down the latest changes when an update is available.

All of the tags described in this changeset are mutable, so they should never be committed. Only immutable SHA values should be used for `gutenberg.sha` in commits to this repository.

This commit also adds the related JavaScript files to the TypeScript configuration file.

Props westonruter, jorbin, manhar.
Fixes #65224.
Built from https://develop.svn.wordpress.org/trunk@62422


git-svn-id: http://core.svn.wordpress.org/trunk@61703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core GitHub Actions Pull requests that update GitHub Actions code [Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants