Răsfoiți Sursa

Fix marketing site preview logic (#10886)

Matt Rubens 3 săptămâni în urmă
părinte
comite
2305888746
1 a modificat fișierele cu 15 adăugiri și 10 ștergeri
  1. 15 10
      .github/workflows/website-preview.yml

+ 15 - 10
.github/workflows/website-preview.yml

@@ -70,15 +70,20 @@ jobs:
                         comment.body.includes(commentIdentifier)
                       );
 
-                      if (existingComment) {
-                        return;
-                      }
-
                       const comment = commentIdentifier + '\n🚀 **Preview deployed!**\n\nYour changes have been deployed to Vercel:\n\n**Preview URL:** ' + deploymentUrl + '\n\nThis preview will be updated automatically when you push new commits to this PR.';
 
-                      await github.rest.issues.createComment({
-                        owner: context.repo.owner,
-                        repo: context.repo.repo,
-                        issue_number: context.issue.number,
-                        body: comment
-                      });
+                      if (existingComment) {
+                        await github.rest.issues.updateComment({
+                          owner: context.repo.owner,
+                          repo: context.repo.repo,
+                          comment_id: existingComment.id,
+                          body: comment
+                        });
+                      } else {
+                        await github.rest.issues.createComment({
+                          owner: context.repo.owner,
+                          repo: context.repo.repo,
+                          issue_number: context.issue.number,
+                          body: comment
+                        });
+                      }