Update src/main.ts

Co-authored-by: August “Kai” Kaiser <85895815+awkaiser-tr@users.noreply.github.com>
This commit is contained in:
Federico 2022-02-22 13:59:30 -05:00 committed by GitHub
parent 2c5912d576
commit 2b9b09ef4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,17 +50,15 @@ async function run(): Promise<undefined> {
header
)
if (!previous && !deleteOldComment) {
await createComment(octokit, repo, pullRequestNumber, body, header)
if (deleteOldComment) {
if (previous) {
await deleteComment(octokit, previous.id)
}
return
}
if (!previous) {
return
}
if (deleteOldComment) {
await deleteComment(octokit, previous.id)
await createComment(octokit, repo, pullRequestNumber, body, header)
return
}
if (hideOldComment) {