File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 2424
2525 echo "API Response: $RESPONSE"
2626
27- if echo "$RESPONSE" | grep -q '" success": true'; then
27+ if echo "$RESPONSE" | jq -e '. success == true' > /dev/null 2>&1 ; then
2828 echo "Successfully deleted $WORKER_NAME"
2929 echo "status=success" >> $GITHUB_OUTPUT
3030 else
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name: Cloudflare Workers Preview
33on :
44 pull_request :
55 types : [opened, synchronize, reopened]
6+ workflow_dispatch :
67
78concurrency :
89 group : cloudflare-preview-${{ github.event.pull_request.number }}
@@ -66,27 +67,27 @@ jobs:
6667 script : |
6768 const previewUrl = '${{ steps.deployment-url.outputs.url }}';
6869 const prNumber = context.issue.number;
69-
70+
7071 // Find existing comment
7172 const comments = await github.rest.issues.listComments({
7273 owner: context.repo.owner,
7374 repo: context.repo.repo,
7475 issue_number: prNumber,
7576 });
76-
77- const botComment = comments.data.find(comment =>
78- comment.user.type === 'Bot' &&
77+
78+ const botComment = comments.data.find(comment =>
79+ comment.user.type === 'Bot' &&
7980 comment.body.includes('Cloudflare Workers Preview')
8081 );
81-
82+
8283 const commentBody = `## 🚀 Cloudflare Workers Preview
83-
84+
8485 Your preview is ready!
85-
86+
8687 **Preview URL:** ${previewUrl}
87-
88+
8889 <sub>Built with commit ${context.sha}</sub>`;
89-
90+
9091 if (botComment) {
9192 // Update existing comment
9293 await github.rest.issues.updateComment({
You can’t perform that action at this time.
0 commit comments