File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 77
77
- name : Get comment body
78
78
id : get-comment-body
79
79
run : |
80
+ previewLink=$(node ./bin/generatePlaygroundPreviewLink.js)
81
+
80
82
body="Plugin build for ${{ github.event.pull_request.head.sha }} is ready :bellhop_bell:!
81
- - Download [build](https://verti-artifacts.s3.amazonaws.com/${{ github.event.pull_request.base.repo.name }}-${{ needs.dev-zip.outputs.branch-name }}-${{ needs.dev-zip.outputs.git-sha-8 }}/feedzy-rss-feeds.zip)"
83
+ - Download [build](https://verti-artifacts.s3.amazonaws.com/${{ github.event.pull_request.base.repo.name }}-${{ needs.dev-zip.outputs.branch-name }}-${{ needs.dev-zip.outputs.git-sha-8 }}/feedzy-rss-feeds.zip)
84
+
85
+ > [!NOTE]
86
+ > You can preview the changes in the <a href=\"$previewLink\" target=\"_blank\">Playground</a>
87
+ "
82
88
body="${body//$'\n'/'%0A'}"
83
89
echo "::set-output name=body::$body"
84
90
- name : Create comment on PR with links to plugin builds
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ // Read GitHub Action environment variables.
3
+ const repoName = process . env . GITHUB_REPO_NAME || '' ;
4
+ const branchName = process . env . DEV_ZIP_BRANCH_NAME || '' ;
5
+ const gitSha8 = process . env . DEV_ZIP_GIT_SHA_8 || '' ;
6
+
7
+ // Create the blueprint object with necessary schema and options.
8
+ const blueprint = {
9
+ preferredVersions : {
10
+ php : '8.0' ,
11
+ } ,
12
+ plugins : [
13
+ 'wpide' ,
14
+ `https://verti-artifacts.s3.amazonaws.com/${ repoName } -${ branchName } -${ gitSha8 } /feedzy-rss-feeds.zip` ,
15
+ ] ,
16
+ login : true ,
17
+ landingPage : '/wp-admin/post-new.php?post_type=feedzy_imports' ,
18
+ features : {
19
+ networking : true ,
20
+ } ,
21
+ } ;
22
+
23
+ // Convert the blueprint object to JSON and then encode it in Base64.
24
+ const blueprintJson = JSON . stringify ( blueprint ) ;
25
+ const encodedBlueprint = Buffer . from ( blueprintJson ) . toString ( 'base64' ) ;
26
+
27
+ // Output the full preview link.
28
+ process . stdout . write ( 'https://playground.wordpress.net/#' + encodedBlueprint ) ;
You can’t perform that action at this time.
0 commit comments