mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-15 02:26:52 +00:00
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:
parent
a020c5690d
commit
b17e5a4390
4 changed files with 2399 additions and 124 deletions
11
src/main.ts
11
src/main.ts
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue