Skip to content

Commit 924279b

Browse files
committed
Fix the link breakage, and match it to the playground proxy
1 parent c553672 commit 924279b

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

.github/workflows/pr-build-live-branch.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,13 @@ jobs:
6969
with:
7070
name: remote-data-blocks-${{ github.event.pull_request.number }}
7171
path: unzips/remote-data-blocks
72-
retention-days: 2
72+
retention-days: 7
7373
if-no-files-found: 'error'
7474
overwrite: true
7575

76-
- name: Output artifact ID
77-
run: echo 'Artifact ID is ${{ steps.create-playground-artifact-step.outputs.artifact-url }}'
78-
7976
- name: Comment on PR with WordPress Playground details
8077
uses: actions/github-script@v7
8178
with:
8279
script: |
8380
const { run } = require('./.github/workflows/scripts/generate-playground-blueprint');
84-
const artifactUrl = '${{ steps.create-playground-artifact-step.outputs.artifact-url }}';
85-
run({ github, context, core, artifactUrl });
81+
run({ github, context });

.github/workflows/scripts/generate-playground-blueprint.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const https = require( 'https' );
22

3-
const generateWordpressPlaygroundBlueprint = ( prNumber, artifactUrl ) => {
3+
const generateWordpressPlaygroundBlueprint = ( prNumber ) => {
44
const defaultSchema = {
55
meta: {
66
title: `Remote Data Blocks - PR #${ prNumber }`,
@@ -41,7 +41,7 @@ const generateWordpressPlaygroundBlueprint = ( prNumber, artifactUrl ) => {
4141
pluginData: {
4242
caption: 'Installing Remote Data Blocks',
4343
resource: 'url',
44-
url: `${ artifactUrl }`,
44+
url: `https://playground.wordpress.net/plugin-proxy.php?org=Automattic&repo=remote-data-blocks&workflow=Build%20Live%20Branch&artifact=remote-data-blocks-${ prNumber }&pr=${ prNumber }`,
4545
},
4646
options: {
4747
activate: true,
@@ -54,7 +54,7 @@ const generateWordpressPlaygroundBlueprint = ( prNumber, artifactUrl ) => {
5454
return defaultSchema;
5555
};
5656

57-
async function run( { github, context, core, artifactUrl } ) {
57+
async function run( { github, context } ) {
5858
const commentInfo = {
5959
owner: context.repo.owner,
6060
repo: context.repo.repo,
@@ -74,9 +74,9 @@ async function run( { github, context, core, artifactUrl } ) {
7474
}
7575
}
7676

77-
const defaultSchema = generateWordpressPlaygroundBlueprint( context.issue.number, artifactUrl );
77+
const defaultSchema = generateWordpressPlaygroundBlueprint( context.issue.number );
7878

79-
const url = `https://playground.wordpress.net/#${ JSON.stringify( defaultSchema ) }`;
79+
const url = `https://playground.wordpress.net/#${ encodeURIComponent(JSON.stringify(defaultSchema)) }`;
8080

8181
const body = `
8282
## Test using WordPress Playground

0 commit comments

Comments
 (0)