Add a WordPress Playground PR Preview workflow so reviewers can test Create Block Theme pull requests directly in the browser without setting up a local WordPress environment.
Create Block Theme requires a build step before it can be previewed correctly, so this should use the build-artifact flow from the Playground PR Preview GitHub Action guide rather than the simple plugin-path: . flow.
Reference: https://wordpress.github.io/wordpress-playground/guides/github-action-pr-preview/
Problem
Reviewing UI or behavior changes currently requires contributors and reviewers to:
- check out the PR locally,
- install Node dependencies,
- run the plugin build,
- set up WordPress,
- activate the plugin,
- Navigate to the Create Block Theme admin page.
A Playground preview button would make PR review faster, especially for design, UI, onboarding, and Site Editor integration changes.
Proposed implementation
Add two GitHub workflows:
-
.github/workflows/pr-playground-preview.yml
A read-only pull_request workflow that:
- checks out the PR head,
- sets up Node using
.nvmrc,
- runs
npm ci,
- runs
npm run build,
- packages a
create-block-theme.zip artifact with a single top-level create-block-theme/ directory,
- respects
.distignore,
- uploads the ZIP and PR metadata artifacts.
-
.github/workflows/pr-playground-preview-publish.yml
A workflow_run publisher workflow that:
- runs only after the build workflow succeeds,
- does not check out or execute the pull request code,
- validates the PR number and head SHA metadata,
- exposes the built ZIP through
WordPress/action-wp-playground-pr-preview,
- generates a Playground Blueprint that installs and activates the built plugin,
- appends the Playground preview button to the PR description.
The preview should land on:
/wp-admin/themes.php?page=create-block-theme-landing
Security considerations
Add a WordPress Playground PR Preview workflow so reviewers can test Create Block Theme pull requests directly in the browser without setting up a local WordPress environment.
Create Block Theme requires a build step before it can be previewed correctly, so this should use the build-artifact flow from the Playground PR Preview GitHub Action guide rather than the simple
plugin-path: .flow.Reference: https://wordpress.github.io/wordpress-playground/guides/github-action-pr-preview/
Problem
Reviewing UI or behavior changes currently requires contributors and reviewers to:
A Playground preview button would make PR review faster, especially for design, UI, onboarding, and Site Editor integration changes.
Proposed implementation
Add two GitHub workflows:
.github/workflows/pr-playground-preview.ymlA read-only
pull_requestworkflow that:.nvmrc,npm ci,npm run build,create-block-theme.zipartifact with a single top-levelcreate-block-theme/directory,.distignore,.github/workflows/pr-playground-preview-publish.ymlA
workflow_runpublisher workflow that:WordPress/action-wp-playground-pr-preview,The preview should land on: