Skip to content

[Enhancement] Add Playground PR Preview button for Create Block Theme pull requests #848

Description

@fellyph

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:

  1. .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.
  2. .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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions