Skip to content

Commit

Permalink
Update playground workflow to run only on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed Mar 7, 2024
1 parent 735df53 commit 13add05
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ jobs:
name: sensei-lms-${{ github.event.pull_request.head.sha }}
path: ${{ github.workspace }}/sensei-lms/
retention-days: 7
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Test the previous changes of this PR with [WordPress Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/admin.php?page=sensei","phpExtensionBundles":["kitchen-sink"],"steps":[{"step":"setSiteOptions","options":{"site_intent":"sensei"}},{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://playground.wordpress.net/plugin-proxy.php?org=Automattic&repo=sensei&workflow=Plugin%20Build&artifact=sensei-lms-${{ github.event.pull_request.head.sha }}&pr=${{ github.event.pull_request.number }}"}},{"step":"installTheme","themeZipFile":{"resource":"wordpress.org\/themes","slug":"course"}}]}).

syntax-check:
name: PHP Syntax Check
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/playground-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Playground Preview

on:
workflow_run:
workflows: ['Plugin Build']
types:
- completed

jobs:
report-build:
if: github.event.workflow_run.event == 'pull_request'
name: Playground Preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create comment with Playground preview
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Test the previous changes of this PR with [WordPress Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/admin.php?page=sensei","phpExtensionBundles":["kitchen-sink"],"steps":[{"step":"setSiteOptions","options":{"site_intent":"sensei"}},{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://playground.wordpress.net/plugin-proxy.php?org=Automattic&repo=sensei&workflow=Plugin%20Build&artifact=sensei-lms-${{ github.event.pull_request.head.sha }}&pr=${{ github.event.pull_request.number }}"}},{"step":"installTheme","themeZipFile":{"resource":"wordpress.org\/themes","slug":"course"}}]}).

0 comments on commit 13add05

Please sign in to comment.