Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try: new action file to create comment and link to playground #56963

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/pull-request-playground-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Leaves a comment on a pull request with a link to test the changes in a WordPress Playground instance.
name: OPTIONAL - Comment on a pull request with Playground details

# Only trigger, when the build workflow succeeded
on:
workflow_run:
workflows: ['Build Release Artifact']
types:
- completed
jobs:
test_using_wordpress_playground:
name: Test using WordPress Playground
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
steps:
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- pr-test-using=wordpress-playground -->'

- name: Create comment
if: steps.find-comment.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- pr-test-using=wordpress-playground -->
## Test using WordPress Playground

:link: [Test this pull request with WordPress Playground](https://playground.wordpress.net/gutenberg.html?pr=${{ github.event.number }}).

### About WordPress playground

[WordPress Playground](https://developer.wordpress.org/playground/) is an experimental project that creates a full WordPress instance entirely within the browser.

#### Please note:

- The Plugin and Theme Directories cannot be accessed within Playground.
- **All changes will be lost** when when refreshing the page or closing the window/tab running a Playground instance.
- A fresh instance is created each time the link below is clicked.
- Every time this pull request is updated, a new ZIP file containing all changes is created. If your changes are not reflected in the Playground instance,
it's possible that the most recent build failed, or has not completed. Check the [list of workflow runs to be sure](https://github.com/WordPress/gutenberg/actions/workflows/pull-request-playground-comment.yml).

For more details about these limitations and more, check out [WordPress playground limitations](https://wordpress.github.io/wordpress-playground/limitations/) in the documentation.
Loading