Skip to content

Use official WordPress Playground PR preview action#724

Merged
pkevan merged 6 commits intotrunkfrom
pkevan/fix-pr-workflow-perms
Mar 11, 2026
Merged

Use official WordPress Playground PR preview action#724
pkevan merged 6 commits intotrunkfrom
pkevan/fix-pr-workflow-perms

Conversation

@pkevan
Copy link
Contributor

@pkevan pkevan commented Mar 11, 2026

Summary

  • Replaces the custom plugin-proxy.php approach with the official WordPress/action-wp-playground-pr-preview@v2 action
  • Build artifacts are exposed via GitHub releases for a reliable public URL, fixing playground previews for both fork and same-repo PRs
  • Removes the now-unused generate-playground-blueprint.js script and its tests

Context

Follow-up to #723. The plugin-proxy.php endpoint relies on the GitHub API pull_requests field on workflow runs, which is not populated for fork PRs. The official Playground action solves this by uploading artifacts to a GitHub release, making them publicly accessible regardless of PR origin.

Test plan

  • Open a PR (from a fork or same-repo) that triggers the Build Live Branch workflow
  • Verify the Comment Playground Link workflow runs after the build completes
  • Verify the playground preview button/comment appears on the PR
  • Click the preview button and verify the plugin loads in WordPress Playground

pkevan added 6 commits March 10, 2026 10:07
Split the build workflow into two: the build step (pull_request trigger,
read-only permissions) and a separate comment workflow (workflow_run
trigger, write permissions). This fixes the "Resource not accessible by
integration" error for fork PRs where the GITHUB_TOKEN is read-only.
Replace the custom plugin-proxy.php approach with the official
WordPress/action-wp-playground-pr-preview@v2 action, which exposes
build artifacts via GitHub releases for a reliable public URL.
This fixes playground previews for both fork and same-repo PRs.
@pkevan pkevan merged commit 60e0b2c into trunk Mar 11, 2026
13 checks passed
@pkevan pkevan deleted the pkevan/fix-pr-workflow-perms branch March 11, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant