@@ -2,7 +2,7 @@ name: PR Playground Preview
22
33on :
44 workflow_run :
5- workflows : ["Test"] # replace with whatever your main CI workflow is called
5+ workflows : ["Test"]
66 types :
77 - completed
88
2020 github.event.workflow_run.event == 'pull_request' &&
2121 github.event.workflow_run.conclusion == 'success'
2222 permissions :
23+ contents : read
2324 pull-requests : write
2425
2526 steps :
@@ -36,42 +37,11 @@ jobs:
3637 });
3738 if (!prs.data.length) throw new Error('No open PR found for this branch');
3839 core.setOutput('number', prs.data[0].number);
39- core.setOutput('ref', context.payload.workflow_run.head_branch);
40-
41- - name : Generate Playground blueprint JSON
42- id : blueprint
43- run : |
44- node - <<'NODE' >> "$GITHUB_OUTPUT"
45- const blueprint = {
46- "$schema": "https://playground.wordpress.net/blueprint-schema.json",
47- landingPage: '/wp-admin/profile.php#two-factor-options',
48- preferredVersions: {
49- php: '7.4',
50- wp: 'latest',
51- },
52- steps: [
53- {
54- step: 'installPlugin',
55- pluginZipFile: {
56- resource: 'git:directory',
57- url: 'https://github.com/${{ github.repository }}',
58- ref: '${{ steps.pr.outputs.ref }}',
59- path: '/',
60- },
61- },
62- {
63- step: 'login',
64- username: 'admin',
65- },
66- ],
67- };
68- console.log(`blueprint=${JSON.stringify(blueprint)}`);
69- NODE
7040
7141 - name : Post Playground preview button
7242 uses : WordPress/action-wp-playground-pr-preview@c8607529dac8d2bf9a1e8493865fc97cd1c3c87b # v2
7343 with :
7444 mode : append-to-description
75- blueprint : ${{ steps.blueprint.outputs.blueprint }}
45+ plugin-path : .
7646 pr-number : ${{ steps.pr.outputs.number }}
7747 github-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments