WordPress / WordPress/create-block-theme

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

Open
#848 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
417
Forks
66
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Playground PR Preview GitHub Action guide, then inspect .nvmrc, .distignore, and the existing build commands. Add .github/workflows/pr-playground-preview.yml and pr-playground-preview-publish.yml, ensuring the built create-block-theme.zip and validated PR metadata reach the publisher safely. Done means a successful pull request gets a Playground preview button opening the specified Create Block Theme admin page.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.