Build Playground links with wordpress-playground-action - #1843
Conversation
Swaps the hand-rolled nightly.link URL construction and the inline `python3 -c` blueprint one-liner for pattonwebz/wordpress-playground-action@v0. Playground links are no longer built on `release`: the action resolves artifacts via nightly.link, which only proxies Actions artifacts, not release assets. Releases already ship the real zip as a release asset, so the release-asset URL branch had no consumer - it only ever reached an echo in the job log, never a PR comment. plugin-slug is pinned rather than inferred, so the activation path stays correct regardless of artifact naming. Adds `actions: read`, which the action needs to verify the artifact exists before building a link. Drops the now-dead `github.event.repository.private == false` guards - the repo is public and the action refuses private repos itself. Verified with actionlint 1.7.7: the two remaining errors (lines 38, 69) are pre-existing and identical to the pre-change baseline. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
The ref build itself is untouched - it still builds and still ships as a release asset. Only its Playground link is removed. That link was already unreachable: `need_ref_build` is only ever true for a workflow_dispatch carrying a ref value, or for a release. It is never true for a pull_request, and the PR comment step is the only place a Playground link is surfaced to a human. So a ref link could only ever have appeared in a manual-dispatch job log. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe workflow uses a dedicated WordPress Playground action for primary builds, passes its URL to pull request comments and summaries, and removes ref Playground URL reporting. ChangesPrimary Playground workflow
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow
participant PlaygroundAction
participant PullRequestComment
participant BuildSummary
Workflow->>PlaygroundAction: Generate primary Playground URL
PlaygroundAction-->>Workflow: Return PRIMARY_PLAYGROUND_URL
Workflow->>PullRequestComment: Pass primary URL
Workflow->>BuildSummary: Pass primary URL and run state
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build-plugin-with-ref.yml:
- Around line 352-361: Update the “Playground (primary)” fallback in the build
summary to distinguish why the primary build was skipped: report release-asset
behavior only when the mode is release, and use a run-neutral message when
skip_primary is caused by a manual ref_param dispatch. Use the existing
steps.setref.outputs.mode value and preserve the successful URL output path.
- Around line 258-279: Update the uses reference in the playground_primary step
from the mutable pattonwebz/wordpress-playground-action@v0 tag to a specific
immutable commit SHA, preserving the existing inputs and execution condition.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a72e356b-a2a4-4942-89c7-ea543232e3f7
📒 Files selected for processing (1)
.github/workflows/build-plugin-with-ref.yml
The summary attributed every missing primary link to a release, but `skip_primary` is also true for a workflow_dispatch carrying a ref param - no release involved - so that run logged something false. Branches on mode/skip_primary instead, with a run-neutral fallback for anything unforeseen. Verified by executing the branch across all five input combinations. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
`--prefer-offline` is an npm flag; composer install has no such option and exits 1 on it, so the build failed before installing anything. It was copy-pasted from the `npm ci --prefer-offline` line three lines below, in 9bed611. Composer uses its cache automatically and --prefer-dist is already present, so there is nothing to replace the flag with. This breaks every gha-build run on develop, not just this branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
|
✅ Accessibility Checker build (primary only)
|
Most of it explained steps that no longer exist, or restated what the step's own `if`/`with` already says. Keeps only the two things reading the step won't tell you. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
Explained a general Actions practice at a spot where the value is a URL from our own action, and the pattern is already visible from the env block two lines below. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
Deletes the local github-script comment step in favour of the action's own sticky comment, using comment-template so the body is unchanged. The action can now render the artifact download link itself - it exposes the artifact ID it already fetches while verifying the artifact exists - so the local step's separate listWorkflowRunArtifacts call is redundant. Behaviour change: the comment is now sticky, updating one comment in place instead of posting a new one per build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
|
✅ Accessibility Checker build
Built from |
Only one zip is ever linked from a PR build, so the qualifier distinguishes it from nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
The comment is sticky now, so GitHub's own "commented N minutes ago" no longer tells you whether what you are looking at is current. Uses head.sha, not the existing short_sha output: for a pull_request event actions/checkout builds the ephemeral refs/pull/N/merge commit, so `git rev-parse HEAD` returns a SHA that is not in the PR's commit list and means nothing to a reviewer. The artifact filename still carries that merge SHA, so the two differ by design. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
The artifact filename carried the ephemeral refs/pull/N/merge SHA while the comment footer carried head.sha, so a build showed two different commits and neither the reader nor the PR's commit list could reconcile them. Resolves it at the source: the version step now reports head.sha on a pull_request, falling back to the checked-out commit otherwise. Filename, comment and the PR's commit list now agree. Non-PR naming is unchanged - `--short` and `--short=8` both yield 8 characters in this repo, so release and dispatch artifacts keep the names they have today. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
Without always(), a failed build left gha-build on the PR, and re-adding a label that is already present emits no `labeled` event - so the trigger was dead until someone removed it by hand. Happened once already. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
Replaces the hand-rolled Playground link building in
build-plugin-with-ref.ymlwithpattonwebz/wordpress-playground-action@v0.Removed: the "Resolve public plugin URLs for Playground" step (manual
nightly.linkURL construction) and the "Build WordPress Playground links" step (an inlinepython3 -cone-liner that base64-encoded the blueprint). Both are now the action's job.Net: -64/+32, one file.
Behaviour changes
No Playground link on
releaseevents. The action resolves artifacts through nightly.link, which only proxies Actions artifacts, not release assets. The old code special-casedreleaseto emit areleases/download/...URL instead — but that URL had no consumer. The PR comment step ispull_request-only, so on a release the link only ever reached anechoin the Summary log. Releases already ship the real zip as a release asset, which is the better artifact anyway.No Playground link for the ref (woocommerce) build. Also already unreachable:
need_ref_buildis only true for aworkflow_dispatchcarrying a ref value, or for arelease— never for apull_request. So a ref link could only ever have surfaced in a manual-dispatch job log.The ref/woo build itself is untouched. It still builds and still attaches to releases. Verified the whole chain is intact:
ref_param=woocommerce→check_ref→update-ref-param.sh→ ref dist build → ref artifact upload →softprops/action-gh-releasepicking upREF_ZIP_PATH.Net effect for reviewers: the PR comment on a
gha-buildlabel looks the same as before.Other changes
actions: readtopermissions:— the action uses it to verify the artifact exists before minting a link, so a wrong artifact name fails at build time instead of at click time.plugin-slug: accessibility-checkeris pinned rather than left to inference, keeping the activation path correct regardless of artifact naming.env:rather than${{ }}interpolated into the script body.github.event.repository.private == falseguards — repo is public, and the action refuses private repos itself.Verification
developas a baseline and got the identical pair (labels.*.namearray-in-template at line 38,github.head_refin an inline script at line 69). Neither is on a touched line, so both are left alone.build_blueprint.pyagainst a real artifact name (accessibility-checker-1.47.0-1804-3959d1e4): the resultingzip-urlmatches the shape the old inline code produced, andplugin-pathresolves toaccessibility-checker/accessibility-checker.php.One JSON difference worth knowing: the new blueprint uses
installPluginwithoptions.activate: trueinstead of a separateactivatePluginstep, and addspreferredVersions: {php: latest, wp: latest}. Same end state, different blueprint shape.🤖 Generated with Claude Code
https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
Summary by CodeRabbit