Skip to content

Commit

Permalink
ci[pr-preview]: remove existing comment instead of updating
Browse files Browse the repository at this point in the history
  • Loading branch information
f-hollow committed Dec 25, 2024
1 parent 1f74bce commit 0aecc0e
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/prw-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,21 @@ jobs:
);
if (existingComment) {
// Update the existing comment
await github.rest.issues.updateComment({
// Delete the existing comment
await github.rest.issues.deleteComment({
comment_id: existingComment.id,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
} else {
// Create a new comment
await github.rest.issues.createComment({
issue_number: ${{ env.PR_NUMBER }},
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
repo: context.repo.repo
});
}
// Create a new comment
await github.rest.issues.createComment({
issue_number: ${{ env.PR_NUMBER }},
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
} catch (error) {
core.setFailed(`Failed to manage PR comment: ${error.message}`);
}
Expand Down

0 comments on commit 0aecc0e

Please sign in to comment.