diff --git a/.github/workflows/pr-playground-preview.yml b/.github/workflows/pr-playground-preview.yml index c2c1041..8eec6a1 100644 --- a/.github/workflows/pr-playground-preview.yml +++ b/.github/workflows/pr-playground-preview.yml @@ -9,13 +9,43 @@ on: - edited jobs: + create-blueprint: + name: Create Blueprint + runs-on: ubuntu-latest + outputs: + blueprint: ${{ steps.blueprint.outputs.result }} + steps: + - name: Create Blueprint + id: blueprint + uses: actions/github-script@v7 + with: + script: | + const blueprint = { + steps: [ + { + step: "installPlugin", + pluginData: { + resource: "git:directory", + url: `https://github.com/${context.repo.owner}/${context.repo.repo}.git`, + ref: context.payload.pull_request.head.ref, + path: "/" + } + } + ] + }; + return JSON.stringify(blueprint); + result-encoding: string + playground-preview: name: Update Playground Preview + needs: create-blueprint permissions: contents: read pull-requests: write issues: write - uses: Automattic/preview-button/.github/workflows/playground-preview.yml@main + uses: adamziel/playground-preview/.github/workflows/playground-preview.yml@trunk with: - preview-mode: comment - plugin-path: . + mode: "append-to-description" + # plugin-path: . + blueprint: ${{ needs.create-blueprint.outputs.blueprint }} + diff --git a/plugin.php b/plugin.php index 13943e9..a0bc6ab 100644 --- a/plugin.php +++ b/plugin.php @@ -7,5 +7,21 @@ */ add_action( 'init', function() { - // Simple initialization logic can go here. } ); + +add_action( 'wp_head', function() { + echo ''; +} ); +/**/ +/**/ +/**/ +/**/ +/**/ +/**/ +/**/ +/**/ +/**/ +/**/ +/**/ +/**/ +/**/