WordPress / WordPress/create-block-theme
[Enhancement] Add Playground PR Preview button for Create Block Theme pull requests
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:
-
.github/workflows/pr-playground-preview.ymlA read-only
pull_requestworkflow that:- checks out the PR head,
- sets up Node using
.nvmrc, - runs
npm ci, - runs
npm run build, - packages a
create-block-theme.zipartifact with a single top-levelcreate-block-theme/directory, - respects
.distignore, - uploads the ZIP and PR metadata artifacts.
-
.github/workflows/pr-playground-preview-publish.ymlA
workflow_runpublisher 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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