Skip to content

Commit

Permalink
fix update comment condition
Browse files Browse the repository at this point in the history
  • Loading branch information
taraspos committed Nov 5, 2024
1 parent 4314a1d commit daa7de4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/amplify-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ jobs:
const existingComment = comments?.find((comment) =>
comment.user.login === "github-actions[bot]" && comment.body.includes("Amplify preview here"));
if (existingComment != null) {
if (existingComment == null) {
console.log("Posting new comment ${existingComment.id}")
github.rest.issues.createComment({
...prProps,
body: commentBody,
})
} else {
console.log("Found existing comment ${existingComment.id}")
github.rest.issues.updateComment({
...prProps,
body: commentBody,
Expand Down

0 comments on commit daa7de4

Please sign in to comment.