diff options
author | Gina Häußge <gina@octoprint.org> | 2021-11-08 16:54:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 16:54:29 +0300 |
commit | 3c094f55852f322e22f8446b61caebee6f30ddc8 (patch) | |
tree | 302654b99be86e53fe166e670522485e83d9ce7c /.github | |
parent | 686eda353603cddaa096dacab58e12ce195b7f2e (diff) |
👷♂️ Fix comment detection logic
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/issue_automation.yml | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/.github/workflows/issue_automation.yml b/.github/workflows/issue_automation.yml index 40a89ba60..3e5b9e016 100644 --- a/.github/workflows/issue_automation.yml +++ b/.github/workflows/issue_automation.yml @@ -109,6 +109,11 @@ jobs: issue_number: context.issue.number, }) const comment = comments.data.find(c => c.user.login === "github-actions[bot]" && c.body.includes(marker)); + if (comment) { + console.log("Found comment, id=" + comment.id); + } else { + console.log("No comment found"); + } if (!labels.includes("triage") || labels.includes("approved")) { console.log("Deleting comment if it exists..."); @@ -127,18 +132,18 @@ jobs: if (!found) { console.log("No bundle found, posting/updating reminder"); const text = REMINDER + "\n" + marker; - if (comment && comment.body !== text) { - await github.rest.issues.updateComment({ + if (!comment) { + await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, - comment_id: comment.id, + issue_number: context.issue.number, body: text }); - } else { - await github.rest.issues.createComment({ + } else if (comment.body !== text) { + await github.rest.issues.updateComment({ owner: context.repo.owner, repo: context.repo.repo, - issue_number: context.issue.number, + comment_id: comment.id, body: text }); } |