Checking for deleteOldComment before createComment and adding guard (#560)

* Checking for deleteOldComment before createComment and adding guard

* Update src/main.ts

Co-authored-by: August “Kai” Kaiser <85895815+awkaiser-tr@users.noreply.github.com>

* halted when deleteOldComment is true

* build dist files

Co-authored-by: August “Kai” Kaiser <85895815+awkaiser-tr@users.noreply.github.com>
This commit is contained in:
Federico 2022-02-25 08:51:56 -05:00 committed by GitHub
parent a020c5690d
commit b17e5a4390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2399 additions and 124 deletions

View file

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