Skip to content

Commit

Permalink
Attempting to make the script redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
ingeniumed committed Feb 21, 2025
1 parent 486c84e commit 2b32d34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pr-build-live-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ jobs:
if-no-files-found: 'error'
overwrite: true

- name: Comment on PR with WordPress Playground details
uses: actions/github-script@v7
- name: Create comment with Playground preview
uses: peter-evans/create-or-update-comment@v4
with:
script: |
const { run } = require('./.github/workflows/scripts/generate-playground-blueprint');
run({ github, context });
issue-number: ${{ github.event.pull_request.number }}
body: |
Test this PR in [WordPress Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/admin.php?page=remote-data-blocks-settings","features":{"networking":true},"login":true,"preferredVersions":{"php":"8.2","wp":"latest"},"steps":[{"step":"defineWpConfigCosts","consts":{"USE_PLAYGROUND_CORS_PROXY":true}},{"step":"installPlugin","pluginData":{"caption":"Installing Remote Data Blocks","resource":"url","url":"https://wordpress-playground.atomicsites.blog/plugin-proxy.php?org=Automattic&repo=remote-data-blocks&workflow=Build%20Live%20Branch&artifact=remote-data-blocks-${{ github.event.pull_request.number }}&pr=${{ github.event.pull_request.number }}"},"options":{"activate":true,"targetFolderName":"remote-data-blocks"}}]}).
6 changes: 4 additions & 2 deletions .github/workflows/scripts/generate-playground-blueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ async function run( { github, context } ) {
}
}

const defaultSchema = generateWordpressPlaygroundBlueprint( context.issue.number );
const defaultSchema = generateWordpressPlaygroundBlueprint(context.issue.number);

const url = `https://wordpress-playground.atomicsites.blog/#${ JSON.stringify( defaultSchema ) }`;
const uriComponent = encodeURIComponent( JSON.stringify( defaultSchema ) );

const url = `https://wordpress-playground.atomicsites.blog/#${ uriComponent }`;

const body = `
## Test using WordPress Playground
Expand Down

0 comments on commit 2b32d34

Please sign in to comment.