-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflows: Add a Playground comment to new PRs.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Add PR Playground Comment | ||
|
||
on: | ||
pull_request: | ||
types: [opened] # Trigger when a PR is first opened | ||
|
||
jobs: | ||
comment-pr: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Read and Base64 encode blueprint.json | ||
id: encode_blueprint | ||
run: | | ||
# Read the content of blueprint.json and base64 encode it | ||
encoded=$(base64 -w 0 assets/playground/blueprint.json) | ||
echo "Encoded Blueprint: $encoded" | ||
echo "encoded=$encoded" >> $GITHUB_ENV | ||
- name: Add PR comment | ||
uses: peter-evans/create-or-update-comment@v2 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
A link to the playground with the base64-encoded blueprint is available: | ||
[Playground Link](https://playground.wordpress.net/#${{ env.encoded }}) |